Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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?
Comment | File | Size | Author |
---|---|---|---|
#6 | feeds-1402788-6.patch | 456 bytes | star-szr |
#1 | files_mime_type-1402788-1.patch | 511 bytes | Thomas Bosviel |
Comments
Comment #1
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedThis patch add MIME type detection with file_get_mimetype().
Comment #2
star-szr@tbosviel - Thanks! I finally got around to testing this, and the patch works as expected for me.
Comment #3
star-szrDo we need tests here? I'm assuming we don't, because this is using core functionality which already has tests. Marking RTBC.
Comment #4
twistor CreditAttribution: twistor commented7.x
http://drupalcode.org/project/feeds.git/commit/ea36f8b
Comment #5
twistor CreditAttribution: twistor commentedComment #6
star-szrPatch for 6.x-1.x-dev.
Comment #7
twistor CreditAttribution: twistor as a volunteer commented