Support » Plugins » Insert GPX file directly

  • Resolved kaskap

    (@kaskap)


    Hello,

    I’m looking for a plugin, which allow me to insert GPX files DIRECTLY to the posts, just like images or audio filest (you know, by uploading it etc.).

    I’ve dug plenty of plugins but with no success.

    wishes,
    Kask

Viewing 6 replies - 1 through 6 (of 6 total)
  • I don’t know of a plugin but you could so this by adding something like:

    add_filter('upload_mimes','demo');
    function demo($mimes) {
    $mimes = array(
    		'gpx' => 'mime_type_goes_here',
    );
    return $mimes;
    }

    to your theme’s functions.php file.

    Thread Starter kaskap

    (@kaskap)

    where exactly I should paste it?
    and how does it works after that?

    First, do you know the mime type for .gpx files?

    Thread Starter kaskap

    (@kaskap)

    no, sorry, I don’t really know what is the mime type, I’m lame… 🙂

    According to Google, you should try application/gpx+xml or text/xml

    So try adding:

    add_filter('upload_mimes','demo');
    function demo($mimes) {
    $mimes = array(
    		'gpx' => 'text/xml',
    );
    return $mimes;
    }

    to your theme’s function.php file – anywhere between the opening <?php and the closing ?> tags (or the end of the file). You should find that you’re then able to upload & insert .gpx files. If you still have problems uploading, you might have to contact your hosts to check that they will allow these files on their servers.

    Thread Starter kaskap

    (@kaskap)

    Thanks for your help, but it doesn’t works, when I put this line I’ve got an php error.
    But I finally found correct plugin, it calls GPS Track On Google Maps 🙂

    so the problem is solved!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Insert GPX file directly’ is closed to new replies.