Bug #3197
Wrong file-type for pdf attachment when using firefox
| Status: | Resolved | Start date: | 2009-04-28 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Martin Helmich | % Done: | 100% |
|
| Category: | Forum | |||
| Target version: | 0.1.8 | Estimated time: | 0.20 hour | |
| Votes: | 0 |
Description
Apparently this is a bug in Firefox, which provides a wrong file-type when uploading a pdf file through a web-form. Some googling showed that this problem with Firefox has been around for years, so no idea when it will be fixed. Therefore I propose a workaround, as it results in errors (attachment not found) when trying to open the attachments in mm_forum.
Workaround for this issue:
fix for pi1/class.tx_mmforum_pi1 function performAttachmentUpload,
ln 2648 (in v0.1.7), something like 2750 in current SVN:
/* fix wrong mime-type for pdf when uploading through firefox
* Mime-type for pdf should be: 'application/pdf'
* FF 3.0.9 Linux gives 'binary/octet-stream'
* FF 3.0.9 Windows gives 'application/octet-stream'
*/
if (($file['type'] 'binary/octet-stream' || $file['type'] 'application/octet-stream') && substr_compare($file['name'],'.pdf',-4,4,true)==0) {
$file['type'] = 'application/pdf';
}
Associated revisions
Fixed bug #3197 : password-forgot-mails contains htmlencodings
Fixed #3197
Fixed #3197
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/mm_forum/trunk@20130 735d13b6-9817-0410-8766-e36946ffe9aa
[Bug 3197] A data mapper in testing mode must mark new records as dummy records, r=niels
History
Updated by Loek Hilgersom about 4 years ago
btw., the bug has been reported for Firefox in 2007:
https://bugzilla.mozilla.org/show_bug.cgi?id=373621
Updated by Martin Helmich about 4 years ago
- Category set to Forum
- Status changed from New to Accepted
- Assignee set to Martin Helmich
- Target version set to 0.1.8
- Estimated time set to 0.20
Updated by Martin Helmich about 4 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100