1

When I upload an image to assets, it just shows the progress bar loading, but it won’t upload my image into assets. Originally, this had worked before, but for some reason it suddenly just stopped working. I’m using Media Temple for my production. I checked my error log and it says:

Got error 'PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0

I’ve checked my files permissions and changed /tmp to 777 and I’ve also changed my assets folder to 777 too. I even checked my disk space for the /tmp folder and it still have 25GB left so it’s not out of disk space.

  • Could you please activate dev mode and show us the response in your network tab from your browser console during the upload? Also did you change the configuration from your sources accidentally? – Robin Schambach Dec 22 '17 at 23:59
  • I got a POST http://gemini.hylinkgroup.com/index.php?p=admin/actions/assets/save-asset 400 (Bad Request) in my network tab. – Holly Do Dec 23 '17 at 0:07
  • 1
    There is nothing more in the response/preview tab even with activated dev mode? What happens when you enter the url manually do you receive an exception from assetcontroller line 74? – Robin Schambach Dec 23 '17 at 0:17
  • I'd contact Media Temple and show the the error message you're getting. It definitely sounds like a disk space or permissions problem on the server somewhere. – Brad Bell Dec 24 '17 at 16:37
  • @RobinSchambach You're right, I got an error on line 74: throw new BadRequestHttpException('No target destination provided for uploading'); – Holly Do Dec 27 '17 at 1:15
2

I know this is a while ago but I ran in to the same issue and thought I'd share the culprit in my particular case.

I adjusted the upload_max_filesize value via a php.ini file from the default 2MB to 10MB, but I misspelled the configuration as upload_max_filesize = 10MB instead of upload_max_filesize = 10M. I was seeing the exact same error as the original poster. Once I fixed the setting, changing 10MB to 10M, the error went away.

| improve this answer | |
1

Try Removing EXIF data from your images

After increasing PHP Memory and upload limits I would still occasionally run into issues while uploading images and it didn't matter if I was uploading local to the server or to an S3 bucket.

So far my issues appear to be PNG files, so I tried making the images smaller not only by actual file sizes but also dimensionally smaller (width x height). My troubled files were as small as 300kb and only 300 x 800 wide when in other cases I had no issues uploading several 3mb+ images in a single shot.

It appears that Craft is quite capable of handling the images so what gives? If the image itself is so basic then maybe some string in the meta data is too long? Well, removing EXIF data has worked well thus far. I found a free program online that lives on the Mac App Store so I am guessing you shouldn't have trouble finding a similar application.

| improve this answer | |
1

In my case I had to increase the client_max_body_size configuration in NGINX so it matches the value of PHP's upload_max_filesize.

| 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.