× Forum for the GPXTrackMap Content Plugin for Joomla! 2.5 and 3.x

Download zip or gpx names are changed

koppie7 created the topic: Download zip or gpx names are changed

3 years 11 months ago

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>'; 

Last edit: 3 years 11 months ago by koppie7. Reason: Solved for now by editing the gpxtrackmap.php file

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum