Results 1 to 3 of 3

Thread: [RESOLVED] Missing a MIME entry on downloading a TEXT file?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Resolved [RESOLVED] Missing a MIME entry on downloading a TEXT file?

    Help

    This code worked fine on my clients 2003 server for simply downloading a TEXT file

    Response.Clear()
    Response.ContentType = "text/plain"
    Response.AppendHeader("Content-Disposition", String.Format("attachment;filename={0}", %Trim(savename)))
    Try
    Response.TransmitFile(thePath)
    Catch e1 System.Exception
    Message = e1.ToString()
    ltlAlert.text = "alert('" + Message + "')"
    leavesr
    EndTry
    Response.End()

    However -- they are going to a 2008 server and it no longer functions. What it downloads is the HTML of the page where the download button it. Please see attached.
    What am I missing in the 2008 IIS configuration? A mime type??

    thanks

    gollnick
    Attached Files Attached Files
    William E Gollnick

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: Missing a MIME entry on downloading a TEXT file?

    Aww come on now.. There is not ONE person from Microsoft or someplace that has an answer for this?

    gollnick
    William E Gollnick

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Missing a MIME entry on downloading a TEXT file?

    Well first, I don't think the people from Microsoft hang out around here... they have their own playground to hang in. Secondly, you're counting on someone having encountered this problem before.... I know I haven't. And I can't say I recall seeing any other posts that come close to this kind of problem. What I do know is that I have done server side work before in downloading files and I've never response.transmitfile ... didn't even know it existed. I've always created a stream and then used the ResponseStream (from Response.GetStream) to send the file (including mime headers) back to the client. That's how we send XML, Excel, and csv files to the client browser for downloading. As long as there's data in the stream (occasionally we run in to the accidental case where there isn't and it generates an error) the user then gets prompted for the download location of the file. It seems to be stable and has always worked for me.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

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



Click Here to Expand Forum to Full Width