.gcode & .stl not allowed ?
-
Hello. I have added theese extensions manually in text as stated – but it does not allow it ?
The page I need help with: [log in to see the link]
-
Hi @123dprint
I hope you are doing well today.
I was able to replicate this issue on my lab site as well. I pinged our Forminator Team to check this. We will post an update here as soon as more information is available.
Kind Regards,
KrisHi again @123dprint
Both extensions are not supported by default by WP core, and that is why adding this in Additional filetypes in Forminator does not work.
You can use this snippet to allow .stl and .gcode extensions
add_filter( 'upload_mimes', 'wpmudev_stl_gcode_add_upload_mime' ); function wpmudev_stl_gcode_add_upload_mime( $mime_types ) { $mime_types['stl'] = 'application/sla'; $mime_types['gcode'] = 'application/x-gcode'; return $mime_types; }
Here is a guide on how to install mu-plugin:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-pluginsKind Regards,
Kris- This reply was modified 8 months, 2 weeks ago by Kris - WPMU DEV Support.
Thank you. Do i add it in code editor or in the form ? Do i need to install the mu-plugin or is this extra ?
Hi @123dprint
I apologize for long delay on our end. It seems we missed e-mail notification about your response, I’m sorry about that!
As for your question:
You need to add this code
1. either to the “functions.php” file of your currently active theme – if it’s a custom child theme
2. or as MU plugin like this:
– create an empty file with a .php extension (e.g. forminator-filetypes-add.php) in “/wp-content/mu-plugins” folder of your site’s WordPress install
– in the first line of that file put a PHP opening tag
<?php
– below it paste shared code
– save the file.
Best regards,
AdamHi @123dprint,
We haven’t heard from you in a while, I’ll go and mark this thread as resolved. Note that you can still reply on this topic.
If you have any additional questions or require further help, please let us know!
Best regards,
LauraSorry, i have been fiddling with it and still no luck. I believe everything is done as described, please see screenshot.
Regards
Hi @123dprint,
The code you have added looks fine, I suppose you are testing with .gcode file? I could notice it works fine when uploading .stl files.
I could notice issues when I try to upload .gcode file format, the .gcode file type isn’t supported out of the box in WP. I’m checking with our developer to see if there is any further suggestion regarding this.
Will keep you posted once we get further feedback.
Kind Regards,
Nithin
Hi @123dprint,
It seems the following should work fine when tested, could you please try the following snippet and then check how it goes?
<?php add_filter( 'upload_mimes', 'wpmudev_stl_gcode_add_upload_mime' ); function wpmudev_stl_gcode_add_upload_mime( $mime_types ) { $mime_types['stl'] = 'application/sla'; $mime_types['gcode'] = 'text/plain'; return $mime_types; }
You can implement the above code using mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-pluginsBest Regards,
Nithin
I had the same problem and by copying the code snipped above I could solve it for STL files. But I couldn’t get to work with STEP files.
I tried to add the following code snipped which did not work:
$mime_types[‘step’] = ‘text/plain’;
How can I get this to work? Thanks in advance!
Hi @change3d,
Hope this message finds you well.
Could you please open a new topic for your issue? Please refer to this link: https://www.ads-software.com/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too
Best regards,
LauraStill no luck :-/
Hi again @123dprint
Please email us at: [email protected]
Subject: ATTN: WPMU DEV support – wp.orgPlease send:
– Link back to this thread for reference (https://www.ads-software.com/support/topic/gcode-stl-not-allowed/)
so that we could review this case more for youKind Regards,
Kris
- The topic ‘.gcode & .stl not allowed ?’ is closed to new replies.