How do I load a GPX file to a page? (3 posts)

  1. dennis.simpson
    Posted 2 years ago #

    When I try to upload a GPX file, I get a security message

  2. Rod Whiteley
    Posted 2 years ago #

    A plugin can add it to the list of permitted file types. Unfortunately I do not know an existing plugin that does that, but you might be able to find one. If you can write a plugin yourself, there is sample code here in the forums — I remember a similar question was asked recently (about a different file type).

  3. This is untested, but you should be able to add this to the functions.php file in your theme:

    function add_upload_mime_types( $mimes ) {
        if ( function_exists( 'current_user_can' ) )
            $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
        if ( !empty( $unfiltered ) ) {
            $mimes['gpx'] = 'application/gpx+xml';
        return $mimes;
    add_filter( 'upload_mimes', 'add_upload_mime_types' );

Topic Closed

This topic has been closed to new replies.

About this Topic