Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hyperlink to a textfile
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00889776
Message ID:
00890135
Vues:
21
>>>>I have a web page that contains hyperlinks to text files so that the user can click the file and download it.
>>>>
>>>>However, if I name the file 'myfile.txt' and hyperlink it, when the user clicks the link, the data is rendered in the users browser. But what I really want is for the browser's Save AS dialog to display asking the user to save the file.
>>>>
>>>>Is there anyway that I can make the hyperlink download the file vs opening the file?
>>>>
>>>>Thanks,
>>>>
>>>>Jerry
>>>
>>>You have to change the header that the server send to your browser bofore the file.
>>>In IIS, you can set it to an entire folder in the property page of the folder.
>>>Add : content-disposition = attachment to the folder and all files under this folder will promt for save when viewed in internet explorer.
>>
>>
>>Hi Gérald. Could you explain this in a little more detail please? I'm not a IIS expert.
>
>OK,
>
>The browser show the ressources based on the Mime-type header and the content-disposition header.
>The plain text mime type is displayed in Internet Explorer by default (as you know).
>
>To change this behaviour, you have to add a "content-disposition" header.
>
>If you have more than one file to download, put them all in the same directory.
>In IIS, select this directory + RightClick -> Properties/HTTP Headers/Custom HTTP Headers -> Add...
>
>Custom Header Name: Content-disposition
>Custom Header Value: attachment
>
>Click OK, OK.
>
>Now, you should see the save dialog in nearly all versions of IE...

Thanks. Useful information.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform