Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi

 

I'm experiencing different behaviour on different machines (all using IE6), and just wondering if anyone has any thoughts as to what the problem is.

 

I have a form that views a file. An ID is passed to the form, which does a lookup to the database and gets the file to open. It then checks which type of file it is, and uses the Response object to present the file to the User.

 

A sample of the code used is:

 

strFile = GetFile(id)

strType= LCase(Right(strFileName, Len(strFileName) - InStr(strFileName, ".", CompareMethod.Text)))

If strType= "doc" Then

Response.ContentType = "application/ms-word"

ElseIf strType= "jpg" Or strType= "jpeg" Or strType= "bmp" Then

Response.ContentType = "image/JPEG"

Else

Response.ContentType = "text/plain"

End If

Response.AddHeader("content-disposition", "inline;filename=" & strFileName)

Response.BinaryWrite(myReader.Item("binData"))

 

The problem is that on some machines, the doc opens up as the .aspx file itself, on other machines it opens the word document. (Word is installed on all machines, and other web pages that have attachments have no such problems).

 

The jpeg files ALWAYS open up ok.

What if the Hokey-Pokey IS what it's all about?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...