• Hi support,
    I’m testing your Download Manager plugin and would like to use it to download gpx files in the frontend for visitors.
    When i try to add a file in the backend via the “Select File” option the selected file is not attached.
    When i select the file from the media library the file is attached but unfortunately the gpx file opens in the browser in stead of being downloaded. This athough the setting ‘open in browser’ is disabled.
    The excepted file types are set to: ‘.gpx, .pdf’ but gpx files nor pdf files won’t attach.
    I tested with disabled plugins to be sure there is no conflict.
    There are no console errors showing.
    WP version is 6.9.4
    PHP version is 8.3.22
    What am i missing here?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Tahasin

    (@tahasin)

    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


    Thread Starter benny54

    (@benny54)

    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
    Plugin Support Tahasin

    (@tahasin)

    Could you please share the name of the theme so we can review it in our test environment?

    Thread Starter benny54

    (@benny54)

    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 😉

    Plugin Support Tahasin

    (@tahasin)

    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.


Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.