File Extention and IE

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi Gurus,
I have a file with extention abc.
I want to create a html page. When user click a link it should open that
file, but IE does not recognise that file(.abc).
What I have to do so that when user click's it it should download it as EXE
or other files.

Please help.
Richard.
 
I have already done that(FileAssociation). When I double click the file it
opens fine. But when I put it in html, IE doesn't recognise it. It tries to
open it as html page, instead of downloading it.

Richard.
 
Is this on a web server? Or a file system?

If webserver...

Doing the fileassociation is not going to help. You need to tell IIS how to
server the file/page.

You do this by adding a mapping properties dialog on IIS or you can
implement either IHttpHandler or IHttpModule in your web application.

HTH
B
 
most reliable way is something like this;

Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1 ' Binary
oStream.LoadFromFile strPath ' strPath is path to file
binaryData = oStream.Read ' file is not in var
Set oStream = Nothing

Response.AddHeader "content-disposition", _
"attachment; filename=""" & strFileName & """"
Response.BinaryWrite binaryData
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top