Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: href for file download?


Message #1 by lynn.curtner@p... on Fri, 1 Mar 2002 20:09:25

I want to include a tag in my aspx page to allow the user to download a 

file - something like:



<a HREF="http://MyServer/MyDirectory/MyFile.exe">Download</a>



When MyFile is a .exe, this works (i.e., it prompts the user to save the 

file), but if it's a .txt it writes the file out in the HTML.  

How/what/where do you specify what file extensions cause one or the other 

kind of behavior?



TIA,

Lynn Curtner
Message #2 by "The Dogers" <thedogers@h...> on Fri, 01 Mar 2002 20:08:24 +0000
>file), but if it's a .txt it writes the file out in the HTML.

>How/what/where do you specify what file extensions cause one or the other

>kind of behavior?



i believe thats the way the MIME types work on the client, ie, the client is 

setup to view it, not save it by default.. you may be able to poke about a 

bit with the html headers to fool the client into thinking its a different 

type though.. couldnt tell you the exact code, but hopefully its a pointer 

:)

--

Dogers



_________________________________________________________________

Chat with friends online, try MSN Messenger: http://messenger.msn.com



Message #3 by "Curtner, Lynn" <lynn.curtner@p...> on Fri, 1 Mar 2002 14:16:23 -0600
I thought it might be a browser setting, too, and that would be fine, 

but I can't find anything on IE6 to specify what to do with different file types...



> ----------

> From: 	The Dogers[SMTP:thedogers@h...]

> Reply To: 	aspx_beginners

> Sent: 	Friday, March 01, 2002 2:08 PM

> To: 	aspx_beginners

> Subject: 	[aspx_beginners] Re: href for file download?

> 

> >file), but if it's a .txt it writes the file out in the HTML.

> >How/what/where do you specify what file extensions cause one or the other

> >kind of behavior?

> 

> i believe thats the way the MIME types work on the client, ie, the client is 

> setup to view it, not save it by default.. you may be able to poke about a 

> bit with the html headers to fool the client into thinking its a different 

> type though.. couldnt tell you the exact code, but hopefully its a pointer 

> :)

> --

> Dogers

> 

> _________________________________________________________________

> Chat with friends online, try MSN Messenger: http://messenger.msn.com

> 

> 




> 

Message #4 by "paulcr" <paulcr@c...> on Sat, 2 Mar 2002 04:32:07 -0000
put it in a zip file it will download then. Its just the way the browser

interprets different types of files

----- Original Message -----

From: <lynn.curtner@p...>

To: "aspx_beginners" <aspx_beginners@p...>

Sent: Friday, March 01, 2002 8:09 PM

Subject: [aspx_beginners] href for file download?





>

> I want to include a tag in my aspx page to allow the user to download a

> file - something like:

>

> <a HREF="http://MyServer/MyDirectory/MyFile.exe">Download</a>

>

> When MyFile is a .exe, this works (i.e., it prompts the user to save the

> file), but if it's a .txt it writes the file out in the HTML.

> How/what/where do you specify what file extensions cause one or the other

> kind of behavior?

>

> TIA,

> Lynn Curtner




$subst('Email.Unsub').



Message #5 by "Dan McKinnon" <mddonna@q...> on Sun, 3 Mar 2002 01:30:26
An easy workaround is to include this in your html content:



"To download this text file, right-click this link and choose: <b>Save 

Target As...</b> Then save the file to your desktop or some other easy-to-

access location."



Using this technique you can download any type of file, even html pages, 

as files rather than having them display in your browser.



HTH,

Dan



Message #6 by "Curtner, Lynn" <lynn.curtner@p...> on Mon, 4 Mar 2002 08:01:07 -0600

Thanks for this tip.  I've never noticed that menu option before...



> ----------

> From: 	Dan McKinnon[SMTP:mddonna@q...]

> Reply To: 	aspx_beginners

> Sent: 	Saturday, March 02, 2002 7:30 PM

> To: 	aspx_beginners

> Subject: 	[aspx_beginners] Re: href for file download?

> 

> An easy workaround is to include this in your html content:

> 

> "To download this text file, right-click this link and choose: <b>Save 

> Target As...</b> Then save the file to your desktop or some other easy-to-

> access location."

> 

> Using this technique you can download any type of file, even html pages, 

> as files rather than having them display in your browser.

> 

> HTH,

> Dan

> 

> 




> 


  Return to Index