Welcome Guest, Not a member yet? Register   Sign In
Upload Class - Some EPS files fail to upload
#1

Version: CI 3.1.0

Uploading EPS files via form, however, in some instances we receive the following error

Quote:Error:

The filetype you are attempting to upload is not allowed.

All EPS file mime-types have been declared in application/config/mimes.php.  Have tried them both individually and as an array below.

Code:
'eps' => array('application/postscript', 'application/eps', 'application/x-eps', 'image/eps', 'image/x-eps'),

The issue appears to be some EPS files contain a first line beginning with ÅÐÓÆ which seems to be and identifier that the EPS file containts a TIFF/WMF preview thumbnail.  This line can mistakenly be interpreted as a Postscript command.

A standard EPS file begins immediately with the type identifier such as "%!PS-Adobe-3.1 EPSF-3.0" .  Apparently code igniter can then not identify this file type properly and fails with the error.  If we open the file in a text editor and remove the offending line, upload succeeds as expected.

Is there a generic mime-type I can use to force and upload without actually identifying the file or some other work around?  We are receiving artwork from many sources and would be unable to inform them of a requirement for modifying their Adobe settings.
Reply
#2

Read EPS
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

I have read the wiki on EPS formats. I do not see anything in there that would give me a hint as to how to work around this issue. I added all the EPS mime type definitions already.

Do I have to add TIFF and WMF types to the EPS mime type detection as well?
Reply
#4

It's an older Adobe file format from what I found and searching it looks like you are out of luck converting it.

You can try searching google for a converter, good luck.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(This post was last modified: 10-27-2016, 07:35 AM by mkzimms.)

I find that hard to believe considering EPS is one of two Adobe formats for vectored art and these files were created in Illustrator CC with default settings.

Would it be possible to circumvent  detect_mime only when the file extension is .eps?  We would like to maintain the functionality for other formats.
Reply
#6

(This post was last modified: 10-27-2016, 11:32 AM by InsiteFX.)

The one you are talking about is an older Illustrator format for DOS and there is no mime type for it.

You would need to create your own method to read the file header and those codes then decide what to do.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB