Download zip or gpx names are changed
koppie7 created the topic: Download zip or gpx names are changed
- koppie7
- Topic Author
- Offline
- Posts: 5
- Thank you received: 1
Hi, when downloading gpx-tracks or zip files the name of the original file is changed with the subfolders in front of the name.
Original filename is: lim-060_margraten_15.7_km.gpx (or zip)
But when downloading from a subfolder the name is changed to:
wandelen_nederland_limburg_lim-060_margraten_15.7_km.gpx (or zip)
"wandelen/nederland/limburg" is the path of where the file is stored inside of the "gpxtracks" folder.
Besides that my zipdownload name is changed to gpx when downloaded (so you don't see it is in fact a zip file) but it can't be opened as gpx of course. If I rename the downloaded "*.gpx" to "*.zip" and extract if afterwards the original filename is extracted and this one can be opened.
For now I'm using download as gpx but I'd rather use zip as download option.
What am I doing wrong?
Update:
Documentation says: 4. Download link type: The link type can either be just a text link or a button.
parameter name: dltype, values: 0 : text link - 1 : button
If the link type is a text link then the above behaviour occurs. When set to link type = button it is downloading as zip, but if set link type = text, it is downloading with extension gpx but in fact this is a zip file.
Did solve the behaviour for now by changing the gpxtrackmap.php file (from line 821 and further.
See below:
if ($this->_params['dltype']==0) // text link
{ $dlcode = '<div class="'.$this->_params['dlclass'].'"'.$cssstyle.'>'.
// '<a href="'.$gpx_path.'" type="application/gpx+xml" download="'.$gpx_file.'" target="_blank">'.$dltext.'</a></div>';
// changed above line to settings below to force browser to download textlink as zip-file instead of gpx
// textlink is in fact a zip file when choosen for zip-download in the plugin settings but extension was converted to gpx.
'<a href="'.$gpx_path.'" >'.$dltext.'</a></div>';
Please Log in to join the conversation.