- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Internet Products
- >
- Forcing IE5 to download a non-registered file typ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2001 11:02 PM
тАО04-30-2001 11:02 PM
Forcing IE5 to download a non-registered file type
We use file extensions like ".pou" & ".uin"
These files are created in ASP on IIS4 and
a link allowed users to download file locally to put on a floppy disc.
This worked since IE4 didn't recognise file ext
so "file download dialogue" was automatically invoked.
Unfortunately for us IE5.5 "data-sniffs" the file,determines it to be text and simply opens file directly in browser.
Does any one know of any clean fix to this?
It seems registry entries not applicable and we cannot add any mime-type stuff internally since the file is sent off to be read by a program (fixed length fields etc.)
Thanks
Steve
- Tags:
- IE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2001 05:29 AM
тАО05-01-2001 05:29 AM
Re: Forcing IE5 to download a non-registered file type
You're right, IE is a bit too secure for its own good sometimes. You might be able to use IFRAME linking or Internet Code Download Linking. Here is an excellent Microsoft article that explains both of these workarounds.
http://support.microsoft.com/support/kb/articles/Q232/0/77.ASP
I'm not sure if either of those would work in your environment but I can't think of any other ways to do this right now. I hope that helps.
Best regards,
Jamie Hughes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2001 09:16 AM
тАО05-01-2001 09:16 AM
Re: Forcing IE5 to download a non-registered file type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2001 06:00 PM
тАО05-01-2001 06:00 PM
Re: Forcing IE5 to download a non-registered file type
Need to set HTTP Headers on IIS5 for your particular file extension:
Go to :Internet Information Services/
Right click to display Properties, click HTTP Headers.
in Mime Map section click Filetypes/New Type
Add (in my case) "pou" with Content-Type(Mime Type) of "application/unknown"
"Application/unknown" is the key to invoking the file download dialogue, it basically tells IE5 not to be clever and do as its told!!!
Note:
No client-side configs are relevant to this
working but you do need to have control/access to the web-server
Thanks for quick replies
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2004 09:25 AM
тАО07-07-2004 09:25 AM
Re: Forcing IE5 to download a non-registered file type
I'm trying to force a file download using asp.I have seen lots for code samples to achieve this.
I'm able to pop up the Open save dialog box when the user clicks a button.The file that i'm trying to force
download is a video file with .asf as the extension.When yo hit on Save,it lets you download the file and you can play it from there.
The only problem is with the Open.If you hit open on the force file dialog box,it tries to open the file inside windows media player
but fails to do.
Does anyone know why it is doing this?I have tried the same code with other files(excel,word) and they all work fine.Open opens them and save lets to save it locally.
Why not with .asf..no clue.
I tried what you said..it does not seem to work...
Here is my code
One way-------
<%
Response.Buffer = True
Dim strFilePath, strFileName
Const adTypeBinary = 1
strfilepath = "C:\inetpub\wwwroot\data\54325\ranitest1.asf"
strFileName = "ranitest1.asf"
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
strFileType = lcase(Right(strFileName, 4))
' Feel Free to Add Your Own Content-Types Here
Select Case strFileType
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case Else
'Handle All Other Files
ContentType = "application/octet-stream"
End Select
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Response.AddHeader "Content-Length", strFileSize
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
%>
Other way-------
<%
Function getBinaryFile(strFilePath)
Dim TypeBinary, oStream
TypeBinary = 1
Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = TypeBinary
oStream.LoadFromFile strFilePath
getBinaryFile = oStream.read
Set oStream = Nothing
End Function
sServerFile = Server.MapPath("/data/54325/test.asf")
'sFile = "CTC012.pdf"
sfile = "ranitest11.asf"
Response.Buffer = True
Response.Clear
'Response.Flush
' I want the file displayed within the browser so dont specify a filename
Response.AddHeader "content-disposition", "attachment; filename=" & sFile
Response.ContentType = "video/x-ms-asf"
Response.BinaryWrite getBinaryFile(Server.MapPath("/data/54325/test.asf"))
response.flush
Response.end
%>
other way---
<%
Dim Stream
Dim Contents
Dim FileName
dim filename1
FileName1 = "ranitest2.asf"
filename = "\data\54325\ranitest2.asf"
Response.ContentType = "application/force-download"
Response.AddHeader "content-disposition", "attachment; filename=" & FileName1
Set Stream = server.CreateObject("ADODB.Stream")
Stream.Open
Stream.LoadFromFile Server.MapPath(FileName)
Contents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
%>
otherway---
<%
FileName = "test122.asf"
Set Stream = Server.CreateObject("ADODB.Stream")
Stream.Open
Stream.LoadFromFile Server.MapPath("data/54325/test122.asf")
Response.ContentType = "video/x-ms-asf"
Response.AddHeader "content-disposition", "attachment; filename =" & filename
Contents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
%>
other way----
<%
File= "phonelist1.xls"
filename = "c:\inetpub\wwwroot\data\54325\phonelist1.xls"
Response.Buffer=True
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set File = FSO.GetFile(Server.MapPath("data\54325\" & File))
response.write filename
'response.end
Set TS=FSO.OpenTextFile(File)
Response.contenttype="application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=" & file
Response.BinaryWrite TS.readall & ""
TS.close
Set TS = Nothing
set File = Nothing
Set FSO = Nothing
%>