getBlob: add two bytes at beginning of ervery file

14 views
Skip to first unread message

Richard Mücke

unread,
Nov 27, 2023, 6:20:48 AM11/27/23
to Xataface
Hi,
I'm using containers to store my files within xataface.
To secure the download I'm using the secure-Setting within fields.ini.

This works, but I recognized that I couldn't open jpeg and zip files after dowmooading.
After further investigation I relaized, that every file I download via a secure=1 secured field, gets two bytes added in the beginning.

The result: the mimetype ist always data and the files cant be opend - depending which software is used.

Why does the getBlob-Action (automatically used with secure=1) adds two bytes at the beginning of each file? How to avoid this?


Example fields.ini
[files_rechnungen_versand]
Type = container
widget:type = file
widget:label = "Rechnung für Versand"
secure=1

Exampe file hex on the server:
0000000 5025 4644 312d 342e 250a e3e2 d3cf 310a
0000010 3020 6f20 6a62 0a0a 3c3c 2f0a 7553 7462
...

Same filer after downloading it via xataface gui:
0000000 0a0a 5025 4644 312d 342e 250a e3e2 d3cf
0000010 310a 3020 6f20 6a62 0a0a 3c3c 2f0a 7553

The first two bytes 0a0a are added. This is a pdf file.
My jpg was extended with 0aff in the beginning...

What am I doing wrong here?
Thanks in advance.

Best regdards
Richard
Reply all
Reply to author
Forward
0 new messages