1

I just started (it wasn't happening before, upload was working fine) getting this error with my file uploads; I am currently on local development environment..

ErrorException (E_WARNING)
fopen(C:\Users\******\****\***): failed to open stream: Permission denied

My upload script;

$filepath = $attachment->storeAs("pdocs/customers", $formattedname);

The weird thing is that it only happens with some files. I am able to upload for instance some image files I have on my desktop. I am uploading it to my s3 account.

What am I missing here?

eleven0
  • 263
  • 6
  • 13

2 Answers2

1

This problem happen because you don't have permission to create the file in storage folder, you can try to test in your develop directory:

chmod -R 777 /storage

IMPORTANT: don't enable 777 in production server. You can read about how to enable storage here.

Thiago Valente
  • 673
  • 8
  • 25
  • I dont understand.... I am trying to upload to my s3 disk.(not local disk) I am not doing anything on local. Second thing, How come I get this error with some of the files I tried to upload? – eleven0 Aug 11 '19 at 22:40
  • @eleven0 I think this a duplicate post, [follow this link](https://stackoverflow.com/a/31724235/11639058) – Thiago Valente Aug 11 '19 at 22:50
0

After couple of tries, I noticed that I only had this issue with files bigger than 2MB. So change your local php.ini file;

post_max_size = 124M
upload_max_filesize = 64M

After doing this, problem was solved.

eleven0
  • 263
  • 6
  • 13