laravel-bridge icon indicating copy to clipboard operation
laravel-bridge copied to clipboard

Uploaded files have incorrect mime type guessed

Open atymic opened this issue 10 months ago • 4 comments

For some reason, only when running on bref the incorrect mime type of files is guessed. Will dig and try to figure out why.

Exact file (fully valid image) https://filebin.net/xkoaborfk6egt6r6/exported_image.png

Image

atymic avatar Apr 29 '25 10:04 atymic

Mac mime check on the file

~/downloads  ❯ file --mime-type -b exported_image.png
image/png

atymic avatar Apr 29 '25 10:04 atymic

The fileinfo guesses, which i'm guessing is used in bref guesses correctly locally. Could this be related to base64 encode issues?

Image

atymic avatar Apr 29 '25 10:04 atymic

I don't understand the problem, your first post shows "image/png"

mnapoli avatar Apr 29 '25 12:04 mnapoli

Hi @mnapoli

When using the laravel file type validations, and for example the extension() method, this is based on the gussed mime type. In the first screenshot (sorry could have been more clear) the first mine type is the client mime type (from headers) and the second is the guessed mime time (bin, incorrectly which causes a validation failure)

atymic avatar Apr 29 '25 21:04 atymic