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

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

CC BY-SA 4.0
2018-09-17T15:27:35.683Z
2018-09-17T15:27:35.683Z
piperhaywood
<p><strong>Try Removing EXIF data from your images</strong></p>

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

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

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

CC BY-SA 4.0
2018-10-19T20:48:42.147Z
2018-10-19T20:48:42.147Z
Adrian271
<p>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.</p>

CC BY-SA 4.0
2019-07-17T15:35:16.553Z
2019-07-17T15:35:16.553Z
devkokov
<p>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: </p>

<blockquote>
  <p><code>Got error 'PHP message: PHP Warning:  File upload error - unable to
  create a temporary file in Unknown on line 0</code></p>
</blockquote>

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

CC BY-SA 3.0
2017-12-22T23:59:52.753Z
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
CC BY-SA 3.0
2017-12-23T00:07:51.803Z
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
CC BY-SA 3.0
2017-12-23T00:17:04.473Z
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
CC BY-SA 3.0
2017-12-24T16:37:18.940Z
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
CC BY-SA 3.0
2017-12-27T01:15:34.393Z
@RobinSchambach You're right, I got an error on line 74: `throw new BadRequestHttpException('No target destination provided for uploading');`
Holly Do
CC BY-SA 3.0
2017-12-27T01:17:08.860Z
Then it's definitely a server/permission issue since the routing works and the request is resolved correctly. Or Maybe your asset volume configuration is wrong?
Robin Schambach
CC BY-SA 3.0
2017-12-27T01:29:00.710Z
This is just really perplexing for me because it was working last month. My base url is /assets/general and the file system path is assets/general. None of these settings were changed. I've found a work around where I ftp up the assets and then use the update assets index for the images to appear on craft. I have craft 2 running on the same server and I've mimic the file permission for this craft 3.
Holly Do
<assets>
Can't upload assets in Craft 3 CMS
# Can't upload assets in Craft 3 CMS

(Asked by: username_0 on 2017-12-22)

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.

**Tags:** assets
> **Comments:**
> **username_1**: 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?  
> **username_0**: I got a POST `http://gemini.hylinkgroup.com/index.php?p=admin/actions/assets/save-asset 400 (Bad Request)` in my network tab.  
> **username_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?  
> **username_2**: 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.  
> **username_0**: @RobinSchambach You're right, I got an error on line 74: `throw new BadRequestHttpException('No target destination provided for uploading');`  
> **username_1**: Then it's definitely a server/permission issue since the routing works and the request is resolved correctly. Or Maybe your asset volume configuration is wrong?  
> **username_0**: This is just really perplexing for me because it was working last month. My base url is /assets/general and the file system path is assets/general. None of these settings were changed. I've found a work around where I ftp up the assets and then use the update assets index for the images to appear on craft. I have craft 2 running on the same server and I've mimic the file permission for this craft 3.  

---

## 3 answers

### Answer by username_3 on 2018-09-17. Score: 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.


---

### Answer by username_4 on 2018-10-19. Score: 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.


---

### Answer by username_5 on 2019-07-17. Score: 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.


---

