<p>The issue lies if you have a Preparse field in that field layout, see details here: <a href="https://github.com/aelvan/Preparse-Field-Craft/issues/23" rel="nofollow noreferrer">https://github.com/aelvan/Preparse-Field-Craft/issues/23</a></p>

CC BY-SA 3.0
2017-03-13T18:47:43.963Z
2017-03-13T18:47:43.963Z
Tim Kelty
<p>I have a front end form for entries. All other fields are working fine however my assets keep throwing errors. </p>

<p>My assets location is set to 'Images/{slug}' in the CP. Server info tells my Imagemagick is installed, on both local and staging environments. </p>

<p>However, when I submit an entry form with a file chosen for the assets field I get an error
'The file XXX does not appear to be an image.'
The odd thing is that the image does actually get uploaded and it's in the expected assets location, but the entry does not get created.</p>

<p>I should add that I can view it within the file directory, but the asset is not indexed into the Assets CP view.</p>

<p>Any ideas?</p>

CC BY-SA 3.0
2017-03-13T14:47:24.350Z
Check your logs / user permission to upload files. It will probably show you what's wrong in the logs
Justin Dekkers
CC BY-SA 3.0
2017-03-13T14:59:46.380Z
I can't tell from the logs anything more useful? Getting `The file “assets58c6b35977b6b4.70042279.jpg” does not appear to be an image. in /Users/Sean/Sites/website/craft/app/etc/image/Image.php:130`

And

`Tried to rotate or strip EXIF data from image and failed: Empty input file /Users/Sean/Sites/website/craft/storage/runtime/temp/assets58c6b35977b6b4.70042279.jpg @ error/jpeg.c/JPEGErrorHandler/331`
shorn
CC BY-SA 3.0
2017-03-13T15:19:47.547Z
The only thing I can think of is the image name having a `.` in it which might be seen as the file type being `.70042279` instead of `.jpg` maybe try uploading a different image?
Justin Dekkers
CC BY-SA 3.0
2017-03-13T15:20:45.243Z
That's not the filename of the image that I'm uploading. I was guessing it was a temp version?
shorn
CC BY-SA 3.0
2017-03-13T15:22:37.533Z
@shorn seeing the exact same behavior your are with a frontend asset field.
Tim Kelty
CC BY-SA 3.0
2017-03-13T15:24:02.117Z
@TimKelty - glad I'm not the only one! Can't quite work out what's happening and it's one of the last things on my list before going live! 
shorn
CC BY-SA 3.0
2017-03-13T15:25:33.527Z
I found a similar question as this one. Maybe try uploading a .PNG as that was the problem in this one:

http://craftcms.stackexchange.com/questions/5415/all-images-uploading-except-jpg-files

If that is the problem you can try a solution there.
Justin Dekkers
CC BY-SA 3.0
2017-03-13T15:49:40.937Z
Tested with PNG. Same issue.
shorn
CC BY-SA 3.0
2017-03-13T15:49:58.013Z
Just tested with devMode off and get this... `Internal Server Error

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'targetId' cannot be null`
shorn
CC BY-SA 3.0
2017-03-13T15:56:11.600Z
From reading other threads, it seems that error is thrown due to same filenames. I tried again with a new image and got the 'does not appear to be an image' error again.
shorn
<assets><frontend><upload>
Front end assets uploading, does not appear to be a an image error
# Front end assets uploading, does not appear to be a an image error

(Asked by: username_0 on 2017-03-13)

I have a front end form for entries. All other fields are working fine however my assets keep throwing errors.

My assets location is set to 'Images/{slug}' in the CP. Server info tells my Imagemagick is installed, on both local and staging environments.

However, when I submit an entry form with a file chosen for the assets field I get an error
'The file XXX does not appear to be an image.'
The odd thing is that the image does actually get uploaded and it's in the expected assets location, but the entry does not get created.

I should add that I can view it within the file directory, but the asset is not indexed into the Assets CP view.

Any ideas?

**Tags:** assets, frontend, upload
> **Comments:**
> **username_1**: Check your logs / user permission to upload files. It will probably show you what's wrong in the logs  
> **username_0**: I can't tell from the logs anything more useful? Getting `The file “assets58c6b35977b6b4.70042279.jpg” does not appear to be an image. in /Users/Sean/Sites/website/craft/app/etc/image/Image.php:130`  And  `Tried to rotate or strip EXIF data from image and failed: Empty input file /Users/Sean/Sites/website/craft/storage/runtime/temp/assets58c6b35977b6b4.70042279.jpg @ error/jpeg.c/JPEGErrorHandler/331`  
> **username_1**: The only thing I can think of is the image name having a `.` in it which might be seen as the file type being `.70042279` instead of `.jpg` maybe try uploading a different image?  
> **username_0**: That's not the filename of the image that I'm uploading. I was guessing it was a temp version?  
> **username_2**: @shorn seeing the exact same behavior your are with a frontend asset field.  
> **username_0**: @TimKelty - glad I'm not the only one! Can't quite work out what's happening and it's one of the last things on my list before going live!   
> **username_1**: I found a similar question as this one. Maybe try uploading a .PNG as that was the problem in this one:  http://craftcms.stackexchange.com/questions/5415/all-images-uploading-except-jpg-files  If that is the problem you can try a solution there.  
> **username_0**: Tested with PNG. Same issue.  
> **username_0**: Just tested with devMode off and get this... `Internal Server Error  CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'targetId' cannot be null`  
> **username_0**: From reading other threads, it seems that error is thrown due to same filenames. I tried again with a new image and got the 'does not appear to be an image' error again.  

---

## 1 answers

### Answer by username_2 on 2017-03-13. Score: 3 | Accepted answer

The issue lies if you have a Preparse field in that field layout, see details here: <https://github.com/aelvan/Preparse-Field-Craft/issues/23>


---

