News for hackers. Stuff that matters.
Re:Students are failing AP tests because the College Board c... by Polylactic_acid on Thursday May 21, 2020 @10:21PM (#23268095)
Most other sites would accept the upload, try to parse it and then return an error message. Its always the sites fault if it just gets stuck
Re:Students are failing AP tests because the College Board c... by httpsterio on Thursday May 21, 2020 @10:28PM (#23268131)
Eh that's not often a good idea. The service should only look at the file header for the mime type and decide based on that if it should even begin to upload.

Mime types can be spoofed and if you read the data blob's mime from its' type, then just an extension rename will fool it. But if you look at the magic numbers you're saving your server's resources and the uploader's time as it doesn't even try to move the file if the mime is not acceptable. No reason not to do it on the client-side first.