Please use gpx = text/xml.
As a result of checking the file mime type of some GPX files, WordPress recognizes “text/xml”.
Therefore, if you turn on “Enable the attempt to determine the real file type of a file by WordPress core.” security option, a GPX file cannot upload due to the security reasons in case of “gpx = application/gpx+xml”.
Then, I released version 2.5.6. This version adds the debug option for checking uploading file mime type.
By enabling both this option (in setting menu) and the “Enable the attempt to determine the real file type of a file by WordPress core.”, the file type is displayed while the Media uploading process. PLEASE keep in mind that file uploads are stopped while they are being processed if both of two options are enabled. Therefore, be sure to disable this debugging option after debugging.
In Addition, if you have other plug-ins (Media Library Assistant, etc.) in your system, they may not work properly.
Hi @kimipooh,
I used your suggestion, but still no success. When I try to upload a gpx file, I can select one from the directory (previously gpx files weren’t even visible), but when I click ‘open file’, the progress bar runs for a bit and then displays the warning in the right-hand section of the screen. Below I added a link to a screenshot of the media library page.
I had neither option enabled, tried enabling first the one and next the other, but no difference. Do I have to clear cache after making changes? I add the gpx mime type via my functions.php file, and any change there immediately shows in the list of allowed mime types
and file extensions on the admin page.
Do you have any suggestions to geet this working?
The screenshot:
https://www.dropbox.com/s/dmlj9djh9xag53s/Screenshot_2020-11-13%20Bewerk%20Fietsroute%20%E2%80%B9%20WTC%20de%20Door%28en%29trappers%20%E2%80%94%20WordPress.png?dl=0
Thanks in advance,
Bert.
You try to disable my plugin and add the gpx in functions.php, try setting the mime type to text/xml.
If that doesn’t work, it may means that WordPress’ mime checker is determining that your gpx file is of the wrong type.
If you can provide us with the gpx file (e.g. a sample), we can check it. If not, please enable my plugin, enable all the security options, upload the gpx file from media and try to check the file type. Note that if you enable debugging among the security options, the upload itself will stop while it’s being processed (it won’t actually upload, it will only show the file type).
I deleted the line for adding the gpx mime in my functions.php and added it in the admin page of your plugin, and now it works like a charm!
The gpx files I use are files I also use on my Garmin bike computer, so they are real gpx files.
Thank you for your suggestions and it’s great I got it working!
Bert.