I know this question has been asked a thousand times in a thousand different ways, but none of those solutions have worked for me.

Problem: I recently updated from php5 to php7. Whenever I attempt to upload an image (have not tried any other file types) I get the attachedError on attempted file upload

My Setup:

  • Drupal 8.6.1
  • PHP 7.2
  • Windows 2012 Server
  • IIS 8

Things I've Tried:

  • I have ensured that IIS users permissions have been set to read/write/modify for the tmp directory.
  • I have explicitly declared the tmp_upload_directory value in php.ini
    • upload_tmp_dir = C:\inetpub\wwwroot\tmp

The reason I believe it is PHP (could definitely be very wrong) is because of the first failed item in the error. "The file php3BF5.tmp....."

  • This could be literally anything. But we don't know your server, your site, your tools etc. We can't go through all possible causes together with you. You need to debug this yourself and then come back when you found the root of your issue and still don't know how to fix this. Although I'd bet that's not really Drupal related in the end. – leymannx Oct 9 '18 at 12:40
  • 1
    It's almost certainly file permissions, either on the /tmp or destination folder. If you want an easier life, stop hosting PHP on Windows - they really don't like each other :) – Clive Oct 9 '18 at 12:49
  • It looks like that you try to upload a .tmp file, have you tried with a normal image like .png or .jpg? – user72672 Oct 9 '18 at 12:54
  • @leymannx I am happy to continue to debug. Would be helpful if you had some helpful debug tips to provide. – Andrew Oct 9 '18 at 12:58
  • @Clive not my choice to host on Windows :( – Andrew Oct 9 '18 at 12:58

upload_tmp_dir existed in two places. I was only updating in one location. Answer came from https://stackoverflow.com/questions/15733183/unable-to-set-upload-tmp-dir-on-iis

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.