1mrankhan's avatar

laravel 5 file upload

I am having some issues with laravel 5 large file uploads to s3 ie: pdf's around 10 to 12mb , all the necessary changes have been, anyone knows what would be the reason.

0 likes
14 replies
dberry's avatar

come on now, you've got to give a little more info than "some issues"... What is the actual error/exception that you're getting?

bashy's avatar

Seeing as you haven't stated what's not working or what issues you're having, let's start from the beginning.

Have you turned on your computer?

7 likes
1mrankhan's avatar

Not sure whether its a silly question to be raised or not, but this is what i am getting as the exception

"FileNotFoundException in Filesystem.php line 35"

but when uploading like say less than 2 mb works fine, this is under homestead env.

bashy's avatar

PHP post_max_size and upload_max_filesize settings are higher than file size?

1mrankhan's avatar

No, I have set it up like 125mb and 100mb respectively,

usman's avatar

@1mrankhan you say that you can upload the files of size less then 2mb to S3 whereas the Exception you have shown is telling me that you are not even using the S3 Flysystem Adaptor.

1mrankhan's avatar

@usman less than 2mb uploads to s3, large once not, exception shows the same

1mrankhan's avatar
 //get the realpath 
    $pdf = File::get(Request::file('file')->getRealPath());      

    //s3
    Storage::disk('s3')->put('books/' . $book->category_id . "/" . $book->file  , $pdf  );
usman's avatar

@1mrankhan before your first statement try to debug using the: Request::hasFile('file'). The exception is being thrown at your first line because your larger files are not being uploaded.

See the output of var_dump(Request::hasFile('file') when uploading the larger files. If it shows false then, there is definitely something wrong with your php settings.

1mrankhan's avatar

@usman you got the point bro, something wrong with the php settings, it throws me out false

bashy's avatar

Have you confirmed the settings are live and working?

Please or to participate in this conversation.