Navigation überspringen

[Gelöst] Add additional upload file types to CRED Form

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 years, 3 months. 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 -

Zeitzone des Unterstützers: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von karenZ vor 4 years, 3 months.

Assistiert von: Luo Yang.

Author
Artikel
#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!