Files uploaded via API (script.php) can't be previewed in browser
I'm not an expert in PHP so this could be entirely wrong, but
I think this is because when uploading via script.php the mime type of the file isn't sent/stored anywhere as it is when a file is uploaded via the web UI. If you generate the mime type when the file is loaded (as I tried here https://gitlab.com/SamFW/Jirafeau/commit/762a73c4096af93ef65726033e86ada353d8397d ), everything works as it should.