WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. dennis.simpson
    Member
    Posted 10 months ago #

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

  2. Rod Whiteley
    Member
    Posted 10 months 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. Scriptrunner (Doug Sparling)
    Member
    Posted 10 months ago #

    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' );

Reply

You must log in to post.

About this Topic

Tags