Hello,
Thank you for testing our Download Manager plugin and for the detailed explanation.
The issue you’re experiencing with the file not being attached is most likely related to the MIME type configuration. If the correct MIME type for .gpx files is not properly recognized or allowed by your server or WordPress setup, the system may prevent the file from being attached.
Kindly apply this code in your theme’s function.php file, this should resolve the issue.
add_filter("wpdm_is_valid_mime_type", "__return_true", 10, 3);
Let me know, how it goes.
Regards
Unfortunately adding the filter in the child theme functions.php file did not solve the issue.
As a workaround i can use attaching the files via the media library. To force this filetype (gpx) to download in stead of showing in the browser i added the following code to the .htaccess file:
# Force file download
<FilesMatch "\.(jpg|jpeg|png|gif|mp3|mp4|mpg|mpeg|avi|txt|gpx)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
# END
Could you please share the name of the theme so we can review it in our test environment?
The name of the theme is Divi version 5.1.
I would think it is independent of the theme because adding/attaching the file is done in the backend. But i’m not a developer 😉
You’re absolutely right, attaching files from the backend is generally independent of the theme.
As I mentioned earlier, this behavior is usually related to how the server or WordPress handles MIME types. In most cases, the filter I shared resolves it, which is why I asked for the theme name.
We will go ahead and test this on our end with Divi to see if we can reproduce the issue and identify what might be preventing the filter from taking effect.
We’ll update you as soon as we have any findings.