View Issue Details

IDProjectCategoryView StatusLast Update
0006047mantisbtattachmentspublic2019-08-30 19:13
Reporterandersg Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status confirmedResolutionopen 
Product Version1.0.0a3 
Summary0006047: Mimetype of attached files.
Description

It would be very nice if file_download.php could report different mimetypes.

Something like this in "Attached Files":

file1.txt (12345 bytes) [view] [download] [delete]
file2.mp3 (99999 bytes) [view] [download] [delete]

where [view] would send the file with its real mimetype (text/plain resp. audio/mpeg) and [download] would send it with application/octetstream so it is downloaded.

TagsNo tags attached.

Relationships

related to 0026095 closedvboctor Support inline playing of audio attachments 
related to 0026102 closedvboctor Support inline playing of video attachments 
parent of 0011045 closedvboctor Display of attached files 
has duplicate 0010904 closeddhx Images attached to bugs can not be viewed in FF 3.5 
related to 0010722 acknowledged Decide attachment preview based on mime type 
related to 0011075 closeddhx File downloading - IE vs non-IE filename bugs 
related to 0011362 closeddhx Picture dowload fails wit exhausted memory error with firefox 3.5.7 but not with IE8 

Activities

dhx

dhx

2009-09-04 07:46

reporter   ~0022867

This is still valid (and required) for the current version of MantisBT.

dhx

dhx

2009-09-04 09:01

reporter   ~0022868

I have attempted to implement this feature. A patch is available at http://git.mantisforge.org/w/mantisbt/dhx.git?a=commit;h=2461dbf12ac2f26a834517515750b7dc428b8987

Note that I haven't tested it yet, as it relies upon a feature new to PHP 5.3.0 (which I don't currently have).

hansj

hansj

2009-09-07 10:25

reporter   ~0022893

@dhx, thanks a lot for the patch.
I've tried it with php5.2 and pecl install fileinfo and it does work!

dhx

dhx

2009-09-07 19:40

reporter   ~0022894

Thanks for testing! I've pulled that patch into 1.3.x as it'll probably need some more work to fix up some of the old code that handles attachment types (not something for 1.2.x I don't think).

dhx

dhx

2009-09-14 03:38

reporter   ~0022912

Actually, I will pull this into 1.2.x because as hansj showed, some people may be able to install the PECL extension in PHP <= 5.2.x

vboctor

vboctor

2019-08-30 19:11

manager   ~0062698

I believe the goals of this issue should be address by 0026102 and 0026095 for audio/video inline playing.

Related Changesets

MantisBT: master 2461dbf1

2009-09-04 08:50

dhx


Details Diff
Issue 0006047: Use finfo PHP functions to determine file types

The finfo class is now standard in PHP 5.3.0 and can be used to
determine the MIME type of attachments. It is best to perform this check
upon each download so that updates in PHP and the libmagic library
behind the scene will apply to all attachments - not just ones created
after the update.
Affected Issues
0006047
mod - file_download.php Diff File

MantisBT: master-1.2.x 7d04c49e

2009-09-04 08:50

dhx


Details Diff
Issue 0006047: Use finfo PHP functions to determine file types

The finfo class is now standard in PHP 5.3.0 and can be used to
determine the MIME type of attachments. It is best to perform this check
upon each download so that updates in PHP and the libmagic library
behind the scene will apply to all attachments - not just ones created
after the update.
Affected Issues
0006047
mod - file_download.php Diff File