First of all, Feeds is a lifesaver.

The only thing I've noticed is that all files imported via Feeds come through with the MIME type of application/octet-stream.

In my testing I've only worked with files uploaded to the same server Drupal lives on, in the private files directory. I am using the File upload fetcher, CSV parser, and Node processor.

From what I can see, Feeds is hardcoding the application/octet-stream MIME type.

[$k] = new FeedsEnclosure($v, 'application/octet-stream');

I'm not sure how the correct MIME type can be detected and added. Would something similar to getMimeType() from core help?



Status:Active» Needs review
new511 bytes

This patch add MIME type detection with file_get_mimetype().

@tbosviel - Thanks! I finally got around to testing this, and the patch works as expected for me.

Status:Needs review» Reviewed & tested by the community

Do we need tests here? I'm assuming we don't, because this is using core functionality which already has tests. Marking RTBC.

Status:Reviewed & tested by the community» Patch (to be ported)

Version:7.x-2.x-dev» 6.x-1.x-dev

Status:Patch (to be ported)» Needs review
new456 bytes

Patch for 6.x-1.x-dev.