setting Response.ContentType

Results 1 to 3 of 3

Thread: setting Response.ContentType

  1. #1
    Join Date
    Dec 1969
    Posts
    5

    Default setting Response.ContentType

    I have a Word document on my server that I'd like the user browsing my website to view by clicking on a link. I heard that the Response.ContentType can be set to "application/msword", but I'm not sure what exactly this is supposed to do. Does anyone have experience with this type of thing?

  2. #2
    Join Date
    Dec 1969
    Posts
    2,854

    Default RE: setting Response.ContentType

    R & D ADODB.Stream Object<BR><BR>You can&#039;t set the content type just by putting a link to it in an HREF. You would need to Read it into a Stream on the Server, then Stream the Binary Content back to the Browser, this is why you would need to set the content type, so the browser knows what it is receiving, and what program it should use to open the file.<BR><BR>Its fine to just have it in an Href, and the user will be asked if they want to save, or open the file. <BR><BR>The reason you would want to use the stream object is so that people cannot see the URL, or Filename of the file you are sending them, as it exists on the server. With the Stream object, you can give it a new name, and the user never sees where (physically) its come from on your server!<BR><BR>HTH.<BR>D.

  3. #3
    Join Date
    Dec 1969
    Posts
    5

    Default RE: setting Response.ContentType

    Do you have any sample code that demonstrates this? BTW, thanks for the reply & I appreciate your help. I will try to figure out how to do what you suggest - but if you have any sample code, that would really cut down on the learning curve for me. Also, what does HTH stand for?<BR><BR>Tybee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •