Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fardeen7337's avatar

laravel chunk

exception : "Pion\Laravel\ChunkUpload\Exceptions\ChunkSaveException" file : "/home/makinnoi/public_html/vendor/pion/laravel-chunk-upload/src/FileMerger.php" line : 25 message : "Failed to open output stream."

I use https://github.com/pionl/laravel-chunk-upload the cod is working fine on localhost xampp but when I upload it on share hosting of greengeeks the above error comes on uploading video I don't know why anyone could help me to solve this?

0 likes
5 replies
s4muel's avatar

does your script/webserver has write permissions to the output file/directory?

1 like
fardeen7337's avatar

@s4muel thanks for replying , if the script has write permissions so it also shouldn't work on xamp localhost but it's working fine there , but on server it's not and could you please let me know how to check the permissions of server? Because I am getting that point

s4muel's avatar

well, your local development could (and probably does) differ from the production setup. depends on your production environment. i suppose it is a linux server. simple ls -la command in that directory should output a list of files/folder and their permissions and file owners. if you are not familiar with it, just google around (how to check file permissions in linux) to see what each column and stuff like rwx means in the output and get familiar with it.

and then check the owner and permissions on the folder/file (in production) your upload script is trying to write to. 🤞

1 like
fardeen7337's avatar

when I run the command of ls -ls I saw many directory and also the directory which is using for storage drwxr-xr-x 8 makinnoi makinnoi 4096 Sep 2 17:03 public/ drwxr-xr-x 5 makinnoi makinnoi 4096 Sep 1 01:14 storage/

these both it means it has a permission right?

s4muel's avatar

makinnoi is the owner of the directory and only "he" has write access. (might be that the webserver runs under that user, but i dont think so).

anyway, if your uploaded files go to .../storage/app/public, that folder needs to be writable by the webserver. that is usually www-data.

if you have sudo access, i would try changing the ownership of that directory to www-data.

sudo chown www-data:wwwdata -R storage/app/public

and have a read about laravel file permissions https://tecadmin.net/laravel-file-permissions/

2 likes

Please or to participate in this conversation.