View Issue Details

IDProjectCategoryView StatusLast Update
0011045mantisbtattachmentspublic2010-02-22 14:34
Reportermbellino Assigned Tovboctor  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0rc2 
Target Version1.2.0Fixed in Version1.2.0 
Summary0011045: Display of attached files
Description

I am having big troubles with attached files. If you click on the links (for example a jpg file of 194,228 bytes), a new page is created, but the content is unreadable by the navigator.
Here are the first 3 lines of the HTML page opened :
�����JFIF�������C�    $.' ",#(7),01444'9=82<.342���C  2!!22222222222222222222222222222222222222222222222222�����"�������������� �������}�!1AQa"q2���#B��R��$3br� 

This HTML page is 379'492 octets ! Which seems big when compared to the uploaded file size.

The same behavior is seen under Internet Explorer or Firefox (last version), Safari, and iCab.

Finally, if you right-click on the link of Mantis, and download it (Save as), there is no problem. The jpg is correctly created.

Any idea? Workaround? Did you also have the same issue?

Tagspatch

Relationships

related to 0011101 closeddhx Headers are sent too late in file_download.php (after content has been written) 
child of 0006047 closeddregad Mimetype of attached files. 

Activities

j-b-m

j-b-m

2009-10-16 13:10

reporter   ~0023217

I had the same issue, that was caused by PHP not finding the fileinfo database that is used by Mantis to find out file types since 1.2 RC2.

I had to make a change in the file file_download.php, on line 129:

$finfo = new finfo( FILEINFO_MIME, config_get( 'fileinfo_magic_db_file' ) );

I changed it to:

$finfo = new finfo( FILEINFO_MIME );

And it worked. From the doc, if you do: finfo(mime, NULL), php will use the default fileinfo database, but I guess that the config_get( 'fileinfo_magic_db_file' ) sometimes does not return NULL when the config value fileinfo_magic_db_file is empty...

rledford

rledford

2009-12-29 14:50

reporter   ~0024011

The change on note 0011045:0023217 corrected the issue I am having described on 0011202:0024010 on issue 0011202.

Related Changesets

MantisBT: master-1.2.x 702001d6

2009-10-24 02:00

vboctor


Details Diff
Fixes 0011045: Display of attached files. Affected Issues
0011045
mod - file_download.php Diff File

MantisBT: master e6bc4638

2009-10-24 02:00

vboctor


Details Diff
Fixes 0011045: Display of attached files. Affected Issues
0011045
mod - file_download.php Diff File