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.

$value[$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?

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

Thomas Bosviel’s picture

Status: Active » Needs review
FileSize
511 bytes

This patch add MIME type detection with file_get_mimetype().

Cottser’s picture

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

Cottser’s picture

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.

twistor’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
twistor’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Cottser’s picture

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

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

twistor’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)