• Resolved toneburst

    (@toneburst)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter toneburst

    (@toneburst)

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

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="https://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

    Thread Starter toneburst

    (@toneburst)

    OK, fixed that one using the ‘upload_mimes’ filter.

    a|x

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘XML File Upload’ is closed to new replies.