Skip Navigation

[Resolved] File not uploading

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

Problem:

Add more allowed mime types and file extensions for Toolset form file field.

Solution:

It needs custom codes, for example:
https://toolset.com/forums/topic/file-not-uploading/#post-1136546

Relevant Documentation:

https://developer.wordpress.org/reference/hooks/upload_mimes/

This support ticket is created 5 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 5 replies, has 2 voices.

Last updated by Luo Yang 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1128352
Screen Shot 2018-10-16 at 9.45.07 AM.png
Screen Shot 2018-10-16 at 9.44.46 AM.png

I am trying to: Upload a file

Link to a page where the issue can be seen: hidden link

I expected to see: A file uploaded

Instead, I got: You cannot upload that file error

The files are uploading to the library fine but not in the cred form

#1128841

Hello,

Please provide more details for the question:
What kind of file type do you want to upload?
Are you using other custom codes/plugin to let it allow to upload in admin side library?

I need to duplicate the same problem and test it in my localhost, thanks

#1136122

I would like to upload a .stl.

I used a php function

function my_custom_upload_mimes($mimes = array()) {
 
  // Add a key and value for the jfif file type
  $mimes['stl'] = "application/wavefront-stl";
 
  return $mimes;
}
 
add_action('upload_mimes', 'my_custom_upload_mimes');
#1136546

Thanks for the details, please try to modify your codes as below:

...
add_filter('upload_mimes', 'my_custom_upload_mimes');

And test again.

More help:
https://developer.wordpress.org/reference/hooks/upload_mimes/

#1136939

My issue is resolved now. Thank you!

#1137196

You are welcome

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.