I have Drupal 8.4 running on Windows Server 2016, and when trying to use an upload field on a content type I get this error

The file phpC128.tmp could not be saved. An unknown error has occurred. File upload error. Could not move uploaded file.

I deleted the files folder and IUSR, account PHP is running under, recreated it for this month as expected, but this still errors out. I see the file in c:\windows\temp but it doesn't make it to my site folder. IUSR has full control to the files folder and the 2018-06 folder.

In IIS, the AppPool is running under ApplicationPoolIdentity as well.

  • 1
    That error usually suggests the server can't write to the target folder - to debug, add a tiny standalone vanilla PHP file to the project which writes a file to the public files folder. If that works fine, you know the problem is somewhere in Drupal, otherwise it's folder permissions or some other environmental factor – Clive Jun 30 '18 at 18:58
  • a basic copy into that folder works, now what? – David Lozzi Jun 30 '18 at 21:46
  • HEY! Updated php.ini to a new path, upload_tmp_dir=C:\Inetpub\temp\php, and it worked!! Yipee! – David Lozzi Jun 30 '18 at 22:09

Moving the file path from `c:\windows\temp' to another location, and after setting the IUSR permissions on that new folder, it worked as expected!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.