corsasport.co.uk
 

Corsa Sport » Message Board » General Chat » HTML/JS Help... » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Dom

posted on 7th Jul 04 at 13:09

paul, the exampl you posted will work fine mate :) and like you say, just pop it into a seperate ASP file and call it or you could pop it into a function/routine and call it from that :thumbs:

however, i would recommend that you have a butchers and www.pscode.com and look up some more examples, because there are other ways to go about it mate (cant remember though, been a long time since ive done stuff in ASP so) :)


Ian

posted on 7th Jul 04 at 12:55

The problem you have is that MIME types are interpretted by the browser, and its up to that to decide what to do with them. What you're doing there is telling it that its basically a foreign ContentType and that data will follow - this is your best of the bad situation as the most the browser can usually do with this is download it somehwere - there will be no app set up to handle it. The problem there of course is that you need to get a filename and file extension in the downloaded file, I'm sure there must be some other hacks somewhere to supply that.

Don't forget - the link is to the file so you shouldn't need to worry about targetting it properly. You don't need a new window as you're about to provide something the browser can't handle anyway, and a Save As box should follow.

Make sure the output from your filedl.asp script is *only* the file (albeit with the spoofed header) and you should be OK.

I'd be looking in other webmail/CMS type apps to see how they do it. Even its its not ASP you should still be able to see how the app is fooling the browser.


PaulW

posted on 7th Jul 04 at 11:34

Or if anyone can help me with headers in asp??

code:

Response.AddHeader "Content-Disposition","attachment;filename=" & fileName
Response.AddHeader "Content-Length", stream.Size
Response.CharSet = "UTF-8"
Response.ContentType = "application/x-msdownload"
Response.BinaryWrite stream.Read



I found that as an example, but I aint sure how to implement it. I suppose the best way would be to call a seperate file (ie, when a download link is clicked, instead of linking straight to the file, it will open something like

http://blahblah.com/filedl.asp?download=\lrc\it\p433.doc

than that page runs through the above header to download the file instead of opening it?? & also closes itself, so it opens up as _blank & then closes once headers have been processed??

arrrrgggg I aint ever worked with HTTP headers before, so I'm lost!

[Edited on 07-07-2004 by PaulW]

[Edited on 07-07-2004 by PaulW]


PaulW

posted on 7th Jul 04 at 10:24

I've seen it done on other sites, but I can't remember for the life of me where...

I want to add links to download files from an online resources system (DOC, PDF, XLS, MDB, etc), and instead of it opening in the same window or a new window, I want it so when the user left-clicks, instead of opening it up in IE or whatever, it displays the Save Target box.

Reason for this, right-clicking has been disabled on the site, so can't right-click, save-target as