Download & Extend

All files are imported as MIME application/octet-stream

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

Status:active» needs review

This patch add MIME type detection with file_get_mimetype().

AttachmentSizeStatusTest resultOperations
files_mime_type-1402788-1.patch511 bytesIgnoredNoneNone

#2

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

#3

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.

#4

Status:reviewed & tested by the community» patch (to be ported)

7.x
http://drupalcode.org/project/feeds.git/commit/ea36f8b

#5

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

#6

Status:patch (to be ported)» needs review

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

AttachmentSizeStatusTest resultOperations
feeds-1402788-6.patch456 bytesIgnoredNoneNone
nobody click here