What rules apply to MIME boundary?

The syntax of a boundary is: boundary := 0*69<bchars> bcharsnospace bchars := bcharsnospace / ” ” bcharsnospace := DIGIT / ALPHA / “‘” / “(” / “)” / “+” / “_” / “,” / “-” / “.” / “/” / “:” / “=” / “?” And the body of a multipart entity has the syntax … Read more

Uploading a csv into Codeigniter

I got it working by adding cbrandolino‘s suggested mimetypes to the config/mimes.php (great tip jljohnstone). So the csv property of my $mimes looks like this now: ‘csv’ => array(‘application/vnd.ms-excel’, ‘text/anytext’, ‘text/plain’, ‘text/x-comma-separated-values’, ‘text/comma-separated-values’, ‘application/octet-stream’, ‘application/vnd.ms-excel’, ‘application/x-csv’, ‘text/x-csv’, ‘text/csv’, ‘application/csv’, ‘application/excel’, ‘application/vnd.msexcel’)

Why am I getting mime-type of .csv file as “application/octet-stream”?

In times like these, the official HTTP specification is always helpful. From RFC 2616 7.2.1 (my emphasis added): Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt … Read more

How to check if an uploaded file is an image without mime type?

My thought about the subject is simple: all uploaded images are evil. And not only because they can contain malicious codes, but particularly because of meta-tags. I’m aware about crawlers that browse the web to find some protected images using their hidden meta-tags, and then play with their copyright. Perhaps a bit paranoid, but as … Read more

Multiple MIME types in Android

In Android 4.4 when using the Storage Access Framework you can use the EXTRA_MIME_TYPES to pass multiple mime types. Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType(“*/*”); String[] mimetypes = {“image/*”, “video/*”}; intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes); startActivityForResult(intent, REQUEST_CODE_OPEN);

HTML 4, HTML 5, XHTML, MIME types – the definitive resource

Contents. Terminology Languages and Serializations Specifications Browser Parsers and Content (MIME) Types Browser Support Validators and Document Type Definitions Quirks, Limited Quirks, and Standards modes. Terminology One of the difficulties of describing this is clearly that the terminology within the official specifications has changed over the years, since HTML was first introduced. What follows below … Read more