MimeType is always application/octet-stream

privado

New Member
I am having a problem that in my ashx.cs handler I always get a content type of \[code\]application/octet-stream\[/code\] even when I upload images.I use uploadify to do the upload, and to begin with I was using uploadify \[code\]v2.1.0\[/code\]. I have since upgraded to uploadify \[code\]3.1\[/code\]. Regardless, I receive \[code\]application/octet-stream\[/code\] as the ContentType using either version.I read that it may be a flash player problem, so I un-installed flash using their uninstaller, and tried both Flash Player \[code\]10.1.102.64\[/code\], and \[code\]11_1r102_55_64bit\[/code\] and tried re-installing the latest version again. All three versions didn't change the content type.I am using Internet Explorer 9, and Windows 7 64bit.My \[code\].ashx\[/code\] handler:\[code\]namespace HttpHandlers{ public class UploadsHandler : IHttpHandler { /// <summary> /// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler" /> interface. /// </summary> public void ProcessRequest(HttpContext context) { try { HttpPostedFile file = context.Request.Files["Filedata"]; string mimeType = file.ContentType; // always application/octet-stream context.Response.ContentType = "text/plain"; context.Response.Write("success"); } catch (Exception ex) { context.Response.ContentType = "text/plain"; context.Response.Write(ex.Message); } } /// <summary> /// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler" /> instance. /// </summary> /// <returns>true if the <see cref="T:System.Web.IHttpHandler" /> instance is reusable; otherwise, false.</returns> public bool IsReusable { get { return false; } } }}\[/code\]I am out of ideas at this point... this was working previously until something changed, and am now trying to figure out what...
 
Back
Top