Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rinat

    (@rinatkhaziev)

    What type of file is gpx? What application uses it?

    Thread Starter hannekemijnklim

    (@hannekemijnklim)

    GPX is https://filext.com/file-extension/GPX

    It’s a gps exchange format.

    Plugin Author Rinat

    (@rinatkhaziev)

    Something like this should do (not tested but this should cover possible mime-types for GPX (at least the ones I found googling)):

    <?php
    add_filter( 'fu_allowed_mime_types', 'hannekemijnklim_fu_allowed_mime_types' );
    function hannekemijnklim_fu_allowed_mime_types( $mime_types ) {
        // GPX can use different mime types
        // Here we use gpx, gpx2 etc to differentiate the keys
        $mime_types['gpx|gpx1'] = 'text/xml';
        $mime_types['gpx|gpx2'] = 'application/xml';
        $mime_types['gpx|gpx3'] = 'application/gpx';
        $mime_types['gpx|gpx4'] = 'application/gpx+xml';
    
        return $mime_types;
    }

    you can also add add_filter( 'fu_is_debug', '__return_true' ); and that will show you mime type of a file you’re trying to upload

    Thread Starter hannekemijnklim

    (@hannekemijnklim)

    Unfortunately it isn’t working.

    When I try to upload a gpx it said: Your submission failed spam checks

    Do you know how I can fix that?

    Plugin Author Rinat

    (@rinatkhaziev)

    disable akismet and recaptcha in settings and try again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘allow users to upload gpx files’ is closed to new replies.