mime-types

Asp.net MVC page is giving Mime type warnings for image files

While I do not see any functionally or jquery UI elements affected by this, but when I access my asp.net mvc web page the chrome developer console is logged with a bunch of error messages like so: Resource interpreted as image but transferred with MIME type application/octet-stream. All of the warnings are for jquery UI images (tho...

What is correct content-type for excel files?

I want excel files on a website to open in Excel when clicked, not get saved on desktop, or get opened embedded in a browser etc. Now obviously it all depends on how everything is configured for each user, but what's the best Content-Type and other settings to achieve just that most of the time? ...

PHP find if file data is an image

Imagine I have some file data in a variable $data. I need to determine whether it is an image or not. No need for details such as corrupt images etc. Firs thought would be getting the file mime type by looking at the magic number and then see whether "image" is in the mime type. No such luck, even if I have a "file extension to mime ty...

Determining the mime type of a file

How can I determine the mime-type of a file (in OCaml)? I am trying to set the language for a GtkSourceView control, but to do that, I need to first determine the language. The only way I can see of doing this is using the mime-type - there is a function that will return the correct language as follows: GSourceView.source_languages_ma...

inline images in email using javamail

I want to send an email with an inline image using javamail. I'm doing something like this. MimeMultipart content = new MimeMultipart("related"); BodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message, "text/html; charset=ISO-8859-1"); content.addBodyPart(bodyPart); bodyPart = new MimeBodyPart(); DataSource ds = new Byte...

How to tell Subversion to display binary files using an external program?

I have some code which, like java, is stored in a binary format, and I have the applications to display and modify this code setup in the Subversion's config file. But when I run svn diff for these file, Subversion prevents me =================================================================== Cannot display: file marked as a binary ty...

How change Subversion's default binary mime-type?

Subversion sets a binary file's svn:mime-type property to application/octet-stream by default. I need to change this default to some other mime-type. When I import for the first time this code, I would like Subversion to set mime-type to the one I choose. The reason is that my code base contains code in binary files (proprietary forma...

Overriding MIME Type in PHP

My site is requesting a remote image which is being transferred with the wrong MIME type. I was wondering how might I override it in PHP to tell it that it's an image? I can't use header('Content-Type') because the image is being used in a HTML document. http://manga.justcarl.co.uk/N/Naruto/494/1 - one of the pages attempting to request...

Can I use a MIME type declaration to get an HTML file to open in MS Word?

Bill James wrote: I was able to render an HTML page with the MIME type set to "application/msword", which caused the browser to spawn Word which imported the html just fine, allowing edits and saving just as if I'd output a real Word doc. That sounds great to me, but I haven't been able to get it to work in any browser (Chrome/FF/S...

Apache serving wrong Content-Type for Rails files

Apache keeps serving up my Rails files with a Content-Type of 'text/plain' in the header. I have mod_mime installed, a mime.types files with all the correct MIME assignments, and the following code in my configuration. Any thoughts? DefaultType text/plain <IfModule mime_module> TypesConfig /etc/apache2/mime.types AddType applic...

pdf errors with php, apache2

Hi-- I'm seeing some strange behavior from some dynamically generated PDFs using the TCPDF library in PHP. Standard lamp stack-- however, if you try to open the PDF from Windows with Acrobat Reader, it gives an error that the "file is damaged and could not be repaired". From Mac, Linux, etc. the file works fine, and opens fine. It also ...

handle json request in PHP

When making an ajax call, when contentType is set to application/json instead of the default x-www-form-urlencoded, server side (in PHP) can't get the post parameters. in the following working example, if I set the contentType to "application/json" in the ajax request, PHP $_POST would be empty. why does this happen? How can I handle a ...

DOMPDF: files with 0 bytes and text/plain mime-type

Hi, I'm using Kohana 3 and pdfview/DOMPDF to generate pdf files but they are generated with 0 bytes and text/plain mime-type. Controller: public function action_pdf() { if(isset($_POST['dados'])) { $pdf = View_PDF::factory('export/pdf'); $pdf->title = ''; $pdf->headers = array(); $pdf->data = array()...

Get MIME Type via PHP

I have local access to files, which I need to get their MIME types. Working in WAMP/LAMP, CodeIgniter, and Zend libraries. What's the best way to get MIME type information? ...

Can you determine if a an email has attachments from just the email header

Can you determine if a an email has attachments from just the email header. If I call the Pop3 command "TOP 1 0" can I determine from the data returned if message has attachments. If not is there anyway of find this out with downloading the whole message and counting the attachments. ...

MIME-type conventions, standards or limitations?

Given a new, proprietary file format that cannot currently be handled by any known application, I assume you can just invent a new MIME type value as follows: Content-Type: application/my-arbitrary-format Assuming this is the way to go, are there any limitations (format, syntax, length, reserved words, or otherwise), standards (IETF, ...

PHP Real file type

I am building a website where the user can upload mp3 files. And, I want to check if the file is a mp3 file. What I need to know is if there is a php function that do that for me. I tried $_FILES['uploadedfile']['type'] But, I does not work like I want, because it returns the file type based on the extension (I tested it only on windo...

Does setting exact mime types for files give improvements?

Hey, I was wondering - does it improve download performance (less file size or smth) when i set exact mime types in server. E.g. for js path in server i will set: application/javascript. ...

Launching an application from a web page without displaying the file open\save prompt in IE.

I have an application that can be passed parameters by supplying a local file containing the parameters on its command line. We also have an ASP.NET web application that can return out applications parameter file. We would like the end user to be able to click on a link to an ASP.NET page that generates the parameter file and have IE dow...

What Content-Type value should I send for my XML sitemap?

I thought I should send "text/xml", but then I read that I should send "application/xml". Does it matter? Can someone explain the difference? ...