navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Is there a way of making a file download directly???

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Is there a way of making a file download directly???
Page: [1]
 
Xenon

 

Posts: 44
Joined: 12/8/2003
From: Madrid, Spain
Status: offline

 
Is there a way of making a file download directly??? - 12/30/2004 13:37:14   
I have a .doc file that I want users to download. So when they click on the link that takes them to the .doc file, the Word file opens up in the explorer. Is there a way of making it download directly as if it was any other file where you click [open] [download] [cancel]?????

_____________________________

.:JAva Terminal:. Webmaster
dpf

 

Posts: 7126
Joined: 11/12/2003
From: India-napolis
Status: offline

 
RE: Is there a way of making a file download directly??? - 12/30/2004 13:39:51   
quote:

the Word file opens up in the explorer
Ive never experienced a word file opening directly in explorer..interesting

_____________________________

Dan

(in reply to Xenon)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Is there a way of making a file download directly??? - 12/30/2004 14:20:19   
Its best to save it as a zip file (easiest and pretty universal), or use some form of stream like so :

Response.ContentType = "application/asp-unknown"
Response.AddHeader "content-disposition","attachment; filename=" & fileName
Set FStream = Server.CreateObject("ADODB.Stream")
FStream.Open()
FStream.Type = 1
FStream.LoadFromFile(filePath&filename)
Response.BinaryWrite FStream.Read()
FStream.Close
Set FStream = Nothing


File path and file name need to be valid.
Such as "C:\inetpub\wwwroot\file.doc"

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to dpf)
Xenon

 

Posts: 44
Joined: 12/8/2003
From: Madrid, Spain
Status: offline

 
RE: Is there a way of making a file download directly??? - 12/30/2004 16:02:33   
Thanks this is work just fine

_____________________________

.:JAva Terminal:. Webmaster

(in reply to Spooky)
Andraw

 

Posts: 13
Joined: 1/16/2005
Status: offline

 
RE: Is there a way of making a file download directly??? - 1/16/2005 21:09:03   
Xenon,
when you use the code above to let user download your .doc file, the pictures/header/footer is still there when user open the downloaded file?

Are you familiar the way to creater word file dynamically by using createObject("Word.Application")? I need more reference about it.

Did you create your .doc file dynamically? did you zip it? how?

Thanks!

Andraw

(in reply to Xenon)
Larry M.

 

Posts: 2845
Joined: 2/20/2003
From: Greenville, South Carolina, USA
Status: online

 
RE: Is there a way of making a file download directly??? - 1/16/2005 21:47:11   
quote:

Is there a way of making it download directly as if it was any other file where you click [open] [download] [cancel]?????


Xenon,

Yes, just hyperlink to the file and publish. You can see an example of a file in both zipped PDF format and native Word (right hand side of page) here:

http://www.easleychamber.org/chamber_history.htm

The Word document will open for viewing in Explorer & FireFox and, optionally, can be printed like any other document. It can also be downloaded. As Spooky mentioned, Word files can be zipped and made available for download as well but, of course, they can't be opened directly in this format.



_____________________________

Larry M.

Reality is the leading cause of stress among those few in touch with it

(in reply to Andraw)
Andraw

 

Posts: 13
Joined: 1/16/2005
Status: offline

 
RE: Is there a way of making a file download directly??? - 1/16/2005 22:34:05   
Larry,

Thanks for your response.
I go to the link and see the source code, it seems that it create the contents in the left side by using html, and create a word file and pdf zip file with the same content, my understand is right? can I dynamically create the left side content by using html, then dynamically save the left side content as word file to let user download?

Andraw

(in reply to Larry M.)
Larry M.

 

Posts: 2845
Joined: 2/20/2003
From: Greenville, South Carolina, USA
Status: online

 
RE: Is there a way of making a file download directly??? - 1/17/2005 13:13:47   
quote:

I go to the link and see the source code, it seems that it create the contents in the left side by using html, and create a word file and pdf zip file with the same content, my understand is right?


Andraw,

Yes, the content is from a single source but offered in two formats to the visitor - Word & zipped PDF,

quote:

can I dynamically create the left side content by using html, then dynamically save the left side content as word file to let user download?


If by this you mean can you create a Word document form HTML?, then the answer is yes. After that, save the Word document and publish as a hyperlinked file. (I create a separate subdirectory under the root of the web named _files to help with site management) It will then open in the visitor's browser with options to print or download.

Not sure what you mean by "dynamically" as it pertains to this particular function.

_____________________________

Larry M.

Reality is the leading cause of stress among those few in touch with it

(in reply to Andraw)
pallavi_lodaya

 

Posts: 1
Joined: 2/2/2005
Status: offline

 
RE: Is there a way of making a file download directly??? - 2/2/2005 2:50:52   
Spooky,

You have mentioned for downloading a file. If I woant to print my word doc, can I open in HTML format as you have mentioned and print it?

(in reply to Xenon)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Is there a way of making a file download directly???
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts