firefly-iii
firefly-iii copied to clipboard
Attachment upload fails (unallowed MIME type application/octet-stream)
Support guidelines
- [X] I've read the support guidelines
I've found a bug and checked that ...
- [X] ... the documentation does not mention anything about my problem
- [X] ... there are no open or closed issues that are related to my problem
- [X] ... it's definitely me, not you
Description
When uploading a certain PDF file to an existing transaction (the file extension and name don't matter) I get a success message, but the attachment is not visible in the transaction itself. When accessing /attachments
the file is shown as 0 KB and not present. I found a hidden error on the /debug
page but I don't know where this error originates from.
Expected behaviour
I would at least expect a visible message about this error. At best the file upload should just work.
Debug information
Debug information generated at 2022-08-08 19:29:56 Europe/Berlin for Firefly III version 5.7.10.
Scope | Version |
---|---|
Firefly III | 5.7.10 |
Firefly III API | 1.5.6 |
Build | (unknown), (unknown) |
DB version | 18 (exp. 18) |
PHP | 8.1.4 |
Host | Linux |
System info | Value |
---|---|
System TZ | Europe/Berlin |
Browser TZ | Europe/Berlin |
App environment | local |
App debug mode | false |
App cache driver | file |
App logging | notice, stack |
Display errors | Off |
Error reporting | ALL errors |
Interface | fpm-fcgi |
Default language | de_DE |
Default locale | equal |
BCscale | 24 |
DB drivers | mysql |
Current driver | mysql |
Trusted proxies (.env) | `` |
User info | Value |
---|---|
Login provider | eloquent |
User guard | web |
Headers | N/A, N/A |
Stateful domains | |
Session start | 2022-08-01 00:00:00 |
Session end | 2022-08-31 23:59:59 |
Session first | 2022-02-01 00:00:00 |
User ID | 1 |
User language | de_DE |
User locale | de_DE |
Attempt at "de_DE.utf8" | 'de_DE.utf8' |
Attempt at "de_DE.UTF-8" | 'de_DE.UTF-8' |
User agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 |
Truncated from this point <----|[2022-08-08 19:13:23] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:13:43] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:15:25] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:16:05] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:22:04] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:22:38] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:29:13] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
[2022-08-08 19:29:52] local.ERROR: Mime type application/octet-stream is not allowed for API file upload.
Steps to reproduce
No response
Additional info
I cannot upload the PDF file in this issue because it contains private data. If I can debug something for you tell me. In case you really need it, I could send you the PDF in private.
I have no troubles uploading PDF files myself. What's your setup like?
This is the first file I have trouble with, all others worked just fine (including multiple PDFs).
I'm running Debian 11.4, apache2 (2.4.54) with php8.1-fpm (8.1.4). I configured a new pool for firefly in php-fpm. File size is 129 KB, php.ini defines:
file_uploads = On
post_max_size = 8M
upload_max_filesize = 2M
and even way bigger files than this strange PDF can be uploaded. I didn't change much besides the new pool.
I just checked the PDF file version: 1.4 (Acrobat 5.x)
Some of the apache site configuration:
Protocols h2 http/1.1
RewriteEngine On
SSLEngine on
# SSLCertificate configured
Alias /firefly/ /var/www/firefly/public/
<Directory /var/www/firefly>
Require all granted
Options SymLinksIfOwnerMatch
AllowOverride FileInfo AuthConfig Limit Options=All,MultiViews
FileETag All
<IfModule proxy_fcgi_module>
# Enable http authorization headers
<IfModule setenvif_module>
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:unix:/run/php/php8.1-fpm-firefly.sock|fcgi://localhost"
</FilesMatch>
</IfModule>
</Directory>
I found the difference for this PDF. I opened it in Notepad++ and found this:
-------------------------------28947758029299
Content-Disposition: form-data; name="censored.pdf"; filename="censored.pdf"
Content-Type: application/x-gzip
%PDF-1.4
I have never seen a gziped PDF.
Neither did I lol. I did discover another issue with uploads. I'll mark it as such and pick it up!
In case someone else stumbles upon this later on and searches for a solution: I fixed my problem by converting the PDF. I used the Adobe compress tool with minimal compression.
Hi there! This is an automatic reply. Share and enjoy
This issue is now closed. Please be aware that closed issues are not actively monitored. If you reply, you may get no response.
- If the original bug is not actually fixed, please feel free to open a new ticket. Please refer to this issue for clarity.
- Follow-up questions can also be posted in a new discussion
Thank you for your consideration.