Why do some of the links given in the background open pictures or download pictures directly?

is there any difference between them?

Apr.03,2021

detect Content-Type/Content-Disposition of both.

https://stackoverflow.com/que.

Content-Type: application/octet-stream
Content-Disposition: attachment; filename= "picture.png"
Means "I don't know what the hell this is. Please save it as a file, preferably named picture.png".

Content-Type: image/png
Content-Disposition: attachment; filename= "picture.png"
Means "This is a PNG image. Please save it as a file, preferably named picture.png".

Content-Type: image/png
Content-Disposition: inline; filename= "picture.png"
Means "This is a PNG image. Please display it unless you don't know how to display PNG images. Otherwise, or if the user chooses to save it, we recommend the name picture.png for the file you save it as".


that's basically what I said upstairs, I added. Browser security policies sometimes prevent files from being downloaded, and sometimes different browsers may have different implementations that prevent files from being downloaded. At this time, the front end needs to do some compatibility processing on its own

Menu