mime-types

ContentType doesnt work, mime=application/octet-stream

In C# i am doing context.Response.ContentType = "image/png"; context.RewritePath(sz); context.Response.ContentType = "image/png"; It seems to redirect the path as i can see see images on my pages. However in firefox when i right click and select "view image" i get a download. Using this c++ code i c...

Browser fails to recognise Content Type header correctly

I have an issue with my browser failing to recognise the content types I am sending in my responses and trying to download the file instead of displaying it. I have a generic handler (named SPARQL.ashx) written in ASP.Net which does some work and produces an object which is of two possible types. Either it gets a SPARQLResultSet or a...

Blackberry: Office attachments can be opened from email but not from browser

Hi, We have a Web application (ASP.NET) which displays in some page links to miscellaneous Office documents. The links are not to web files but rather to a web page which dynamically loads the content form a network folder then sends it to the browser by appropriately setting the mime type. Everything works fine when testing with desk...

Content type set incorrectly in javax.mail.Part

I have a javax.mail.Part and need to modify the content, so I have code like this: System.out.println(part.getContentType()); String content = (String) part.getContent(); content = content.replace("a", "b"); part.setContent(content, part.getContentType()); System.out.println(part.getContentType()); This prints out text/html then text/...

Why Does FireFox Not Include the .xml Extension when Downloading a File?

OK. I'm sure it does download XML files with the .xml extension, but I'm wondering what is missing in the code here to cause the .xml extenstion to be missing from the downloaded file. Note: This works in IE 6+ (didn't try WebKit based browsers or Opera) private void GenerateXmlAttachment(string xmlInStringFormat, string fileName) { ...

What is the best method to detect xml in JavaScript

What is the best method to detect xml in JavaScript e.g. is it possible to detect the mime type of a document - particularly if it is text/xml in JavaScript. this needs to work in Chrome. thanks, Josh ...

How do I determine the extension(s) associated with a MIME type in PHP?

Is there a quick and dirty mapping of MIME types to extensions in PHP that I can make use of? ...

Force Mime Type in Browser (with Javascript)

[I imagine that this is impossible due to security concerns, but:] Is it possible to force the browser to handle a file with a certain mime type without controlling the server? I'm serving up files from file:// (on the client's machine itself) and I'd like to get text files to open in whatever their associated text editor is. Note: Fir...

How to set mime type for windows?

Hi, I have found that for the support of rounded corner in IE, need to use htc file and for that I need to set mime type. But I am unable to find the place for this local server(windows). So can anyone suggest me where to find and how to set for both windows and linux server. I have checked the site http://www.htmlremix.com/css/curve...

Unknown file type MIME?

Do I have to specify a MIME type if the uploaded file has no extension? In other words is there a default general MIME type? ...

Is there a way to get ALL the MIME types instead of wrinting a huge case statement?

Hi I want to populate Response.ContentType = "text/plain"; From somewhere in the server/web/dictionary ALL possible MIME types according to file extension: public string GetMimeType(string extension) { //This is what I am looking for. } Also, I have to rename the file (at least if going to be downloaded, so I have to know ...

II7 Allow asmx files to be downloaded

Hi there, I'm using II7 and bits down loader to deploy my application to customers. Can someone please tell me how to allow asmx files to be downloaded and not executed on IIS 7. I tried to do this with the MIME type, but no luck. Regards ...

Where can I find out what the mime types are for these extensions?

I'm trying to set dynamic compression in IIS 7 and I know I want to enable compression for these file types (along with others): asmx and asjx. However IIS 7 wants their mime type not the extension. Does anyone know where I can find out what the mime-type is? The best I found is text/plain but I highly doubt that's correct. ...

Parsing JSON Payload in Rails When Using Custom MIME Type

A Rails application with a RESTful interface needs to accept POST data using a custom MIME type based on 'application/json'. Let's call that MIME type 'application/vnd.com.example.Foo+json'. Registering the custom MIME type in Rails using Mime::Type.register works fine in that the application recognizes the MIME type given in the "Accep...

MimeType Extraction from shell32

Hi friends, Would it be possible to extract the mimetype by importing shell32.dll in C#? Can anyone help me on this? For example: for pdf it should retrieve -Adobe Acrobat Document I could be able to extract using regkeys, but I'm looking for a way to extract using shell32.dll ...

pdf download problem

Hi friends, I just want to add a link for pdf file. But when i click on the link then pdf file open in the browser, But i want that user prompt for to save or open the pdf file. Thanks in advance. ...

ColdFusion 8 always opens .XLS, want .XLSX

I am using ColdFusion 8. Doing something like this: <cfheader name="content-disposition" value="attachment; filename=abc.xlsx"> <cfcontent type="application/msexcel"> <html> But I get a file like abc.xlsx.XLS. The reason I'm trying to get an XLSX is because sometimes the XLS version is so large and Office 2007 gets stuck opening it o...

Why is mime_content_type() deprecated in PHP?

I'm just curious to know why mime_content_type() is now considered deprecated. This method for determining the mime type is much easier than the replacement Fileinfo functionality. ...

Rails app crashes and burns when sending a GET request with Content-Type header set

I have created a rails application that has a simple RESTful json API. This has worked for a while, but now we have run into a problem. The javascript framework that makes requests adds a "Content-Type" header to all requests . . . including GET requests. It sets the header to "application/json" and causes the rails app to crash and burn...

Retrieving information about an Image

Good day, Anybody knows of a good java library for retrieving mime type and dimension of a jpeg, gif, and png image file in java? I tried javax.imageio.ImageIO but it seems that there are some image files that it can't handle (i.e. images created with adobe photoshop). Thanks, Franz ...