Forums

[resolved] XML File Upload (3 posts)

  1. toneburst
    Member
    Posted 3 months ago #

    Hi,

    I'm trying to write a plugin to allow Google Maps KML file uploading. I've managed to add a filter to add the KML MIME type ( application/vnd.google-earth.kml+xml ), but I'm still no able to upload. When I attempt to upload a KML file, I'm told 'Sorry, this file type is not permitted for security reason'. I assume that's because it's an XML-based file. Is it possible to code a plugin to allow just this type of XML file?

    a|x

  2. toneburst
    Member
    Posted 3 months ago #

    Incidentally, the header of a Google Maps KML file says the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.2">

    I don't know if WordPress reads the second line here to determine what kind of data the file contains when a file is selected for upload, or if it just sees 'xml' on the first line, and bails at that point.

    a|x

  3. toneburst
    Member
    Posted 3 months ago #

    OK, fixed that one using the 'upload_mimes' filter.

    a|x

Reply

You must log in to post.

About this Topic

Tags