Infos:
- Used Zammad version: 5.3.1-1677147662.62001c62.bullseye
- Used Zammad installation type: package
- Operating system: Debian GNU/Linux 11 (bullseye)
- Browser + version: -
Expected behavior:
- Successfully uploaded avatar image
Actual behavior:
- {“error”: “The image is invalid.”}
Steps to reproduce the behavior:
- curl https://xxx.xxx.xxx.de/api/v1/users/avatar -v -u username:pw -H “Content-Type: application/json” -X POST -d ‘{“avatar”: “data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKQbGNtcwQwAABtbnRyUkdCIFhZWiAH4QACAA8ABwAuAA1hY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9t…”}’
I tried several images. I even fetched one base64 encoded image from an existing avatar and used that one. But without success! The command I used is from the source code of Zammad:zammad/app/controllers/users_controller.rb:826
I tried several things in Postman (raw-data, form-data), and I dug a bit deeper and checked the image validate class (zammad/app/services/service/avatar/image_validate.rb) and even the static_asset (zammad/lib/static_assets.rb).
The image is null, or the StaticAssets.data_url_attributes(image_data)
function recognizes that the base64 string is invalid. But the image I provide exists and is not too big or has an invalid mime type.
I hope someone has an idea. I am slowly getting crazy with this!
Thanks.