Reputation: 459
Basically, I tried to upload a file and after the app created a folder inside public, every action routed me to localhost/videos. Then whenever I delete the folder it created, the behavior reverts to normal. How can creating a folder inside public which isn't even in the app folder mess up the routing? I am using Laravel 4.2 and PHP 5.5.10.
This is what I did:
$filename = date('Y-m-d-H:i:s')."-".$client_file_name;
$destinationPath = base_path() . '\public\uploaded_video';
Input::file('post')->move($destinationPath, $filename);
the second line messes up the routing and then everything becomes back to normal when I delete the folder. Is it because I am running on Windows or something? I tried doing '/public/uploaded_video' instead, but I think it didn't work.
Upvotes: 1
Views: 50
Reputation: 146191
Actually any_Path
function returns the local path on the server but you need a url
so in this case, you may try something like this:
$destinationPath = asset('uploaded_video');
More on Laravel website.
Upvotes: 1