Posted by Cottser on January 12, 2012 at 3:34pm
3 followers
| Project: | Feeds |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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.
<?php
$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?
Comments
#1
This patch add MIME type detection with file_get_mimetype().
#2
@tbosviel - Thanks! I finally got around to testing this, and the patch works as expected for me.
#3
Do we need tests here? I'm assuming we don't, because this is using core functionality which already has tests. Marking RTBC.
#4
7.x
http://drupalcode.org/project/feeds.git/commit/ea36f8b
#5
#6
Patch for 6.x-1.x-dev.