June 24, 2018 at 9:25 pm #542
I am using the shortcode to generate the link [sdm_download_link id=””]. I am trying to download the GPX file in a new window (target=”_blank”). This isn’t working and the gpx file is opened in the current tab of the internet browser. See rondjedoen.nl/alle-klassiekers-vanuit-spa/ in the sidebar –> Download Route button. Is there a way to download the file in a new window when using the [sdm_download_link id=””] shortcode?
Thanks!June 24, 2018 at 9:36 pm #543
This is my code:
<a href="[sdm_download_link id="1041"]" title="Download Route" target="_blank" > Download Route </a>June 24, 2018 at 11:10 pm #551
WordPress doesn’t let you use any shortcode inside the value of the “href” parameter. So what you have there is not going to work.
Since you want to create a link, you could use the option explained in the following documentation. See the “Download URL That Can be Used in an Email or in a Link” section:June 27, 2018 at 11:50 am #554
Yes, thanks for your response. When I am using this approach, the file still opens in Firefox and IE instead off a popup to download the file. In Google Chrome the target blank is working properly. I also manually created some download files without the Simple Download Monitor plugin shortcode. These are downloading correctly (not in the internet browser for both IE and Firefox). See code below:
<a href="<?php echo '/wp-content/uploads/gpx/' . $gpx_url; ?>" target="_blank" download="" title="Download Route" class="btn btn-primary btn-lg">Download Route</a>
See the difference when clicking on the download route button on the right sidebar:
with download monitor plugin: rondjedoen.nl/rondje-ringvaart/
without download monitor plugin (manually created link): rondjedoen.nl/fietsen-langs-kinderdijk/
Could you help me out? Or is this just a restriction of the plugin?June 27, 2018 at 1:52 pm #558
Looks like it is failing to properly read that file. Are you using PHP dispatch option in that download item’s configuration? If you are how does it behave if you uncheck that option?June 27, 2018 at 2:11 pm #560
No I am not using the PHP dispatch option, PHP dispatched was already unchecked.June 28, 2018 at 4:20 am #568
What happens if you enable the PHP dispatch option? What happens if you put that file inside a folder and make it a .zip file?
This is a little strange so I am trying various things to see if there is a setup that works better on this site.June 28, 2018 at 12:17 pm #570
When I enable the PHP dispatch option, nothing changes and the file still opens in the web browser. When I put the file in a folder and zip it, the download function works fine and the zip file is downloaded the way I want it. But I would like to offer the file directly to the users instead off in a .zip file. Of course this is a option, but do you think it is also possible with the .gpx file?
I just noticed that it is not possible to upload a gpx file, when I want to upload a file in the download item. A message appears “Sorry, this file type is not permitted for security reasons”. Might it have to do with this? Before I manually placed a link to the gpx file on my server (which I uploaded by the WP GPX Maps).
I really appreciate your help!June 28, 2018 at 12:51 pm #571
WordPress restricts uploading of some file types. You can use the following addon to remove that restriction:
After that you should be able to upload that file using the media uploader.June 28, 2018 at 1:43 pm #572
I downloaded and activated the plugin. But still I am not able to upload the GPX file. Are you sure this plugin is also compatible with the .gpx extension?
Do you think this is also the reason why the file cannot be downloaded outside the internet browser?June 29, 2018 at 12:29 am #573
I am not sure about the .gpx extension. I never dealt whit that extension before. The browsers are likely getting a little suspicious about it and stopping it. I would say its better for you to go with the zip file approach then you eliminate this issue. Its very common to receive a zip file as a download when you download an item from a website.June 29, 2018 at 10:16 am #593
Yes, you are right. I will do that. Thanks for your help.
I still have another question. I only want to make the downloadable files available for people that have logged in. When enabled the option “Only Allow Logged-in Users to Download” at the settings page. If I am logged out and I click on the download button, first a the browser has a problem loading and the message ‘File not found’ appears. When I refresh that page, a page appears with the message
You need to be logged in to download this file. Click here to go to login page.
I would like to have this page directly after clicking the download button when you are logged out. Now users first see an page with an error. I want to directly motivate them to loggin. Is that possible?June 29, 2018 at 3:15 pm #594
Never mind. I already found a solution. Thanks for all your help.
- You must be logged in to reply to this topic.