kamish's avatar

Upload files folder

Hey , I understand that the server automatically blocks access to the storage folder . How do I find the path of the file after coming to the server ?

``` Input::file('file')->move(storage_path(),Input::file('file')->getClientOriginalName());

 $image = Input::file('file')->getClientOriginalName();

 $id = Auth::user()->id;



 $user = User::find($id);

 $user->profile_image = $image;
 $user->save();
0 likes
8 replies
bashy's avatar

In PHP, it will upload to its temp folder. You can find that in phpinfo().

I would use a different folder than the storage one.

2 likes
kamish's avatar

How can I get access to write to other folders ? What should I write in the terminal ?

bashy's avatar
bashy
Best Answer
Level 65

If Unix/Linux based and Laravel 4.2.*

chmod -R 777 app/storage

Or if you don't want to make it 777 (world writable), do this so the group of your webserver user can read/write

chmod -R 775 app/storage;chgrp -R <web_user> app/storage
1 like
bashy's avatar

Great! If it solved your problem there's a "Mark as Answer" button to the right of each reply

lara8336's avatar

The best method is to set your upload-folder in public since it material from the outside the app works with. (folder 755, files 644)

Please or to participate in this conversation.