I have JPEG photos being stored as binary data which I am then displaying on a reactive web page. If I right-click on the photo and click Save Picture As in Chrome or Edge, it is saving the file with a JFIF extension. Does anyone know if this is normal behavior or a problem with my app?
Hi Dan,
The problem is not with your app, but with how the browser is interpreting the data. The file extension of an image is automatically found and set by the browser when no content type is provided.
The following page shows two possible solutions, but it will be a user by user fix...
https://ourcodeworld.com/articles/read/1550/how-to-fix-the-error-of-saving-jpeg-images-into-jfif-on-google-chrome-for-windows-10
Side note
It seems the JFIF extension is not that wrong, we are just not used to it.
JFIF is the file format; JPG is the compression method JPG/JFIF is specified in the JPEG File Interchange Format and JPEG (ISO 10918). in https://www.archives.gov/preservation/products/definitions/jpg.html#:~:text=JFIF%20is%20the%20file%20format,well%20as%20JPG%20compression%20encoding.
Regards,
Ricardo
Thank you. Is there a way for me to provide a content type or an extension to the browser when displaying binary data?
Here I found something on google but not sure how we can do with outsystems,
https://nspeaks.com/jpg-images-getting-saved-as-jfif-heres-how-to-fix/
Thanks,
Ajit Kurane.
I don't think there is an easy way to do it with Outsystems. Maybe if you create an API as shown at https://www.outsystems.com/forums/discussion/39185/exposed-api-need-to-return-content-type-as-text-xml/ .
But I'm not even sure if it will help you, as the MIME type will state "image/jpeg" and the Windows registry will map that with the "JFIF" extension. Did you confirm your register is configured as shown on the post I shared previously?
Ok. Thank you. Yes, I checked my registry and the extension is set to ".jfif" as the post states. I'll have to look into why that is set that way and if it is possible for my organization to change that value.