Returning files in my Response : ContentType wanted

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Returning files in my Response : ContentType wanted

    Hi,

    I return a file to the client browser by using Response.WriteFile

    Now, there can be multiple type of files, and I need to specify the
    contenttype.

    Is there a way of getting this out the file itself, or am I stuck with
    determinating it from the file extention?


    Bart


    Bart Vanwesemael Guest

  2. Similar Questions and Discussions

    1. problems setting Response.ContentType
      I'm having issues trying to set the Resposne.ContentType from a Component on a (skeleton) ASP page -- the ASP goes like: <%@ Language=VBScript %><%...
    2. Response.ContentType = "application/vnd.ms-excel"
      Hi , I have my asp successfully creating excel file viewable through IE using the header: Response.ContentType = "application/vnd.ms-excel" ...
    3. Wanted: Help/Script to truncate mp3 files.
      Hello. I would like to learn how to write a script that would truncate a mp3 file to a given number of seconds of music. This is like what amazon...
    4. Stored Procedure not returning the wanted resultset
      My stored procedure is not returning the resultset I am expecting. The procedure is: CREATE PROCEDURE hms.getHMStest( @userid int, @userrole...
    5. Response.ContentType
      Whats the difference between..?? "application/x-msexcel" and "application/vnd.ms-excel"
  3. #2

    Default Re: Returning files in my Response : ContentType wanted

    The lazy way I usually do it, is to set the content type to
    application/octet-stream. And let the user machine decide how to open it.

    HTH,

    bill

    "Bart Vanwesemael" <bva@ezos.com> wrote in message
    news:uTKph4QVDHA.3376@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > I return a file to the client browser by using Response.WriteFile
    >
    > Now, there can be multiple type of files, and I need to specify the
    > contenttype.
    >
    > Is there a way of getting this out the file itself, or am I stuck with
    > determinating it from the file extention?
    >
    >
    > Bart
    >
    >

    William F. Robertson, Jr. Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139