How to allow other file types in the upload field, like .psd or .ai

If you’re using Advanced Product Field’s file upload field, you may have noticed not all file types are allowed to be upload. This is not due to our plugin, but a WordPress security feature. Per default, WordPress only allows certain file types to be uploaded. You can find a list of allowed file types here. Configuring your site to accept other file formats, for example .psd or .ai, can be done in two ways.

1. through a plugin

You can use a free plugin like File Upload Types to configure additional file types. This is the easiest method, but requires an additional (albeit very lightweight) plugin.

2. through a code snippet

You can add a code snippet to your site that allows extra file types. You’ll need to know the MIME-type of the file format you want to allow. Find the list of MIME-types paired with file extensions here. The following example code allows SVG and photoshop files:

Supply your license key to unlock the code

Since this is a custom-coded snippet, please enter your license key so we can verify your purchase.

You can add multiple extensions by adding them to the $mime_types array. The array key is the file extension, like psd, and the array value is the MIME-type.

Once the code snippet is added, you can edit your file upload field and select the file restricted file types: ai, ai(2), psd, psd(2).

ZIP files

Are you trying to upload ZIP files but are met with a This file type is not support error? This help article explains what to do!

Was this article helpful?

Related Articles