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

ryanborum's avatar

Permission denied on file upload with IIS

Hi all, I'm hosting an application on IIS and am having an issue with my file uploads. When I upload the file, I get the following error: fopen(D:\IIS\server-name\wwwrootapp-name\public): failed to open stream: Permission denied

This seems weird, because the physical path for my application in IIS is the public folder and the rest of the application displays correctly.

I'm not sure what causes this issue. I have given full 'Modify' permission to IUSR, and have a working symbolic link from my 'public' folder to 'storage/app/public'

Here is the line dealing with file storage:

$filename = $request->documents[$i]->storeAs('docs', $request->documents[$i]->getClientOriginalName(), 'public');

In addition, I have no problem writing log/view files in storage, so it seems the issue is with the public folder. If anyone has any experience with this issue I'd be happy to hear it. Thank you!

0 likes
1 reply
ryanborum's avatar
ryanborum
OP
Best Answer
Level 1

For those with the same issue, the solution was to give full access to the user : 'IIS_IUSRS'

The user didn't initially appear, but it's because it only existed on the server, and I was searching for users within my enterprise domain, which only had 'IUSR'

Please or to participate in this conversation.