#WebDev

The Correct MIME Type for Adobe Illustrator (.ai) Files

Available for new projects • My templatesRefer them & earn up to $59

Author: Radu

If you have a form that accepts file uploads, then using MIME types for file validation is the more secure way to go, rather than creating an array with the file extensions.

But, as I recently discovered, finding the correct MIME type for Adobe Illustrator .ai files is a bit tricky.

Adobe Illustrator is not mentioned on IANA

If you head over to IANA, which holds all the official MIME types, you’ll notice that Adobe Illustrator is not even mentioned.

Adobe mentions “application/postscript”

If you head over to Adobe’s Assets User Guide, you’ll see that they mention application/postscript as a MIME type for the Adobe Illustrator .ai file extension.

But does it work? No. I tried.

So, What is the Correct MIME Type for Adobe Illustrator .ai Files?

It’s application/pdf. Yep.

What do PDF files have to do with AI files?

Well, it seems that they’re related. According to this Wikipedia article, Adobe Illustrator Artwork (AI) is …

a proprietary file format developed by Adobe Systems for representing single-page vector-based drawings in either the EPS or PDF formats. The .ai filename extension is used by Adobe Illustrator.

So, there’s that.

Won’t users be able to upload PDF files, too, with that MIME type?

Unfortunately, yes.

Unless there will be a separate MIME type especially for Adobe Illustrator files, application/pdf will enable users to upload both .ai and .pdf files.

You could create another type of validation to block PDF files, though, as a workaround.

That’s a Wrap

I hope this post has helped you out.

If you're interested in my web design services or templates, want to collaborate, or just have something to say, feel free to shoot me a message.

About Radu

I've been working online from home for over 11 years, gaining valuable experience and developing a wide range of skills, including web design and development, optimization, and SEO.

More posts