Connexion | Inscription | FAQ
Anonymous

Why wont my SETUP.LST file download?

+ Publier une réponse

8 messages Page 1 sur 1


Why wont my SETUP.LST file download?

par LeonCS » Mer Sep 17, 2014 7:30 am

Hi
Using the normal syntax <a href="certainFile.ext">Download</a>
two files oneFile.Cab and anotherFile.exe are downloaded as would expect, but - -
the last file has a .LST extension - and it will not download??
The browser actually opens the file as a link and displays the contents of the file on the browser screen.
I want it to download??
*** actual code that does not work ***
<a href="SETUP.LST">Download</a>

Thanks for your consideration and suggestions
Avatar de l’utilisateur

LeonCS

  • Messages: 21
  • Inscrit le: Sam Oct 19, 2013 11:15 am

Re: Why wont my SETUP.LST file download?

par nanoverso » Mer Sep 17, 2014 7:29 pm

This is configured in the browser, the filetype .LST is configured to auto open and display as text.
Avatar de l’utilisateur

nanoverso

  • Messages: 248
  • Inscrit le: Sam Mai 10, 2014 12:08 am
  • Localisation: Brazil
--
Mario Blog (Portuguese): https://jogosdomariosuperbros.blogspot.com

Re: Why wont my SETUP.LST file download?

par LeonCS » Jeu Sep 18, 2014 11:00 am

Thanks very much for your reply.
Both Internet Exploror and Google Chrome do the same thing. Why. It is annoying.
Avatar de l’utilisateur

LeonCS

  • Messages: 21
  • Inscrit le: Sam Oct 19, 2013 11:15 am

Re: Why wont my SETUP.LST file download?

par XainPro » Sam Sep 20, 2014 6:05 am

try this code
this will force a browser to download
<a href="SETUP.LST" download>Download</a>
Avatar de l’utilisateur

XainPro

  • Messages: 3933
  • Inscrit le: Ven Fév 17, 2012 8:10 pm

Re: Why wont my SETUP.LST file download?

par LeonCS » Sam Sep 20, 2014 10:29 am

No, sorry, it did not work. <a href="SETUP.LST" download>Download</a> did not download still.
Thanks anyway.
Avatar de l’utilisateur

LeonCS

  • Messages: 21
  • Inscrit le: Sam Oct 19, 2013 11:15 am

Re: Why wont my SETUP.LST file download?

par XainPro » Lun Sep 22, 2014 5:23 am

Here’s How:

Upload the file you want to make available for download to your web server. For example,

SETUP.LST

Edit a new PHP file in your web editor—I recommend naming it the same name as your downloaded file, only with the extension .php. For example:

SETUP.php

Open the PHP block:
Add this code in php file
Your PHP file should look like this:

<?php
header("Content-disposition: attachment; filename=setup.lst");
header("Content-type: application/octet-stream");
readfile("setup.lst");
?>

Link to your PHP file as a download link. For example:

<a href="setup.php">Download SLT file</a>
Avatar de l’utilisateur

XainPro

  • Messages: 3933
  • Inscrit le: Ven Fév 17, 2012 8:10 pm

Re: Why wont my SETUP.LST file download?

par LeonCS » Lun Sep 22, 2014 8:57 am

Thanks very much. I have not yet learnt php. I assume use note pad to make a new file named SETUP.php with the code in it you supplied, and then copy that to website so it resides in the same directory as my SETUP.LST. And reference it as you showed. Give me a chance to try this. Thanks.
Avatar de l’utilisateur

LeonCS

  • Messages: 21
  • Inscrit le: Sam Oct 19, 2013 11:15 am

Re: Why wont my SETUP.LST file download?

par LeonCS » Lun Sep 22, 2014 9:27 am

No - that doesnt work either? - not as I understand it. Maybe I should read up on php.
Thank you kindly.
Avatar de l’utilisateur

LeonCS

  • Messages: 21
  • Inscrit le: Sam Oct 19, 2013 11:15 am


+ Publier une réponse

Page 1 sur 1