Added support for .stl file but cannot download

Question

I am trying to add a download link to an .stl file after I allowed it in the mime variable.
I created a product with a download link and it does work but I want to give a direct access to the file in order to put it on one of my posts.

I searched google and tried many things using the functions.php and the .htaccess file but none worked.

When I’m trying to directly access the file I am redirected to a 404 page.

This is the code I used to add support for the .stl file:

function my_myme_types($mime_types){
    $mime_types['stl'] = 'application/vnd.ms-pki.stl'; //Adding stl extension
    $mime_types['rar'] = 'application/x-rar-compressed'; //Adding rar files
    $mime_types['zip'] = 'application/zip   '; //Adding zip files
    return $mime_types;
}

add_filter('upload_mimes', 'my_myme_types', 1, 1);

If needed any information please let me know and I will add those.

0
Omer 3 years 2020-03-30T04:51:14-05:00 0 Answers 105 views 0

Leave an answer

Browse
Browse