Skip Navigation

[Resolved] Add additional upload file types to CRED Form

This thread is resolved. Here is a description of the problem and solution.

Problem:

We need to allow extra file types uploads through the File Upload Field (on the Front-End Forms).

Solution:

You can try with another plugin to add mime type into your website, for example:

https://wordpress.org/plugins/wp-add-mime-types/

Relevant Documentation:

This support ticket is created 3 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by karenZ 3 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#2299061

Hello,
We need to allow .ai, .eps, and .svg file uploads through the File Upload Field (on the Front-End Forms). I've tried the method noted under this support ticket: https://toolset.com/forums/topic/cannot-upload-gpx-file-in-the-front-end/

Here is the code I added based on the support forum article:

add_filter('mime_types','add_custom_mime_types');
function add_custom_mime_types($mime_types){
$mime_types['eps'] = 'application/postscript';
$mime_types['ai'] = 'application/postscript';
$mime_types['svg'] = 'image/svg+xml';
return $mime_types;
}

When we test the form, we receive an errors message that says, "Error Some Required Upload Field Failed".

Can you advise how to make this work correctly? Thanks.

#2299647

Hello,

The custom codes you mentioned above is outdated, please try to use another plugin to add mime type into your website, for example:
https://wordpress.org/plugins/wp-add-mime-types/

I have tried above plugin in my localhost, it works fine, for example:
ai = application/postscript

#2300191

My issue is resolved now. Thank you!