News for hackers. Stuff that matters.
Re:Students are failing AP tests because the College Board c... by treesprite82 on Thursday May 21, 2020 @09:50PM (#23267911)
It does have pretty much exactly that message. The corruption problems came from students seeing that only PNGs/JPGs were allowed, then trying to "convert" the file just by renaming it.

What they're doing is the same as 99% of other sites that expect images. But it's probably fair to expect it to be even more streamlined (i.e: clear conversion instructions) given the circumstances of a time-limited exam.

Re:Students are failing AP tests because the College Board c... by LeifCarrotson on Thursday May 21, 2020 @10:27PM (#23268124)
No, what 99% of sites are doing is

    <input type="file" accept="image/png, image/jpg, image/jpeg" />
If you do that, Safari will convert the HEIC image to a JPEG automatically when you try to upload it.

What they did instead was to poorly reinvent the accept header in Javascript as follows:

    <input
      type="file"
      ...
      onChange={async e => {
        const split = file.name.split('.')
        const fileType = split[split.length-1].toLowerCase()
        const isAllowedExtension = extensions.includes(`.${fileType}`)
      }}
    />
(per https://news.ycombinator.com/item?id=23261598).
Re:Students are failing AP tests because the College Board c... by askvictor on Thursday May 21, 2020 @10:51PM (#23268244)
That might be part of the problem, though other comments also point out that students were copying file to a computer, then changing file extension, then uploading. Possibly this was as a result of the iOS browser rejecting the file in the first place due to the shoddy input filtering mentioned.

But going a bit bigger picture, the problem is that we still use file extensions to denote file type.

Re:Students are failing AP tests because the College Board c... by Wowfunhappy on Thursday May 21, 2020 @11:16PM (#23268346)
This keeps getting brought up because there was one anecdote in the Verge story about a student who renamed the file on their computer. (Which still shouldn't have caused the test to keel over, but it's at least slightly more understandable.)

However, there were many other reports of students going the more "normal" route of just uploading through their iPhones, which caused the website to outright hang.

Re:Students are failing AP tests because the College Board c... by zaroth on Thursday May 21, 2020 @10:40PM (#23268189)
> If you do that, Safari will convert the HEIC image to a JPEG automatically when you try to upload it.

That’s quite impressive actually and much more than I would expect from a browser’s <input type=“file”> control.

Re:Students are failing AP tests because the College Board c... by smt88 on Friday May 22, 2020 @12:19AM (#23268588)
It's also not what a browser should do.

JPEG conversions will vary in quality and size. On some sites (e.g. a CMS), quality can be sacrified to stay within file size limits.

On other sites, like photo printing services, quality is much more important.

These may be unusual cases, but silent browser assumptions are still an overstep.

Re:Students are failing AP tests because the College Board c... by zaroth on Friday May 22, 2020 @01:38AM (#23268967)
There's nothing stopping the user from doing a conversion themselves if they want to (and know how, which is asking a lot).

The server is saying it can't read the other file type, so the alternative is to fail.

Re:Students are failing AP tests because the College Board c... by Thorrez on Friday May 22, 2020 @01:55AM (#23269052)
There's a medium option: have an alert popup saying

    Convert the image to a format the site accepts (jpg)?

    [ ] Don't show this message again

    [OK] [Cancel]
Re:Students are failing AP tests because the College Board c... by lightgreen on Friday May 22, 2020 @04:43AM (#23269910)
Anecdotally, yesterday I accidentally learned that my relative clicks OK in any dialog window within 200ms without even attempt to read the message. So the alert you suggest would slightly help 1% of geeks and will annoy 99% of the users.
Re:Students are failing AP tests because the College Board c... by Thorrez on Friday May 22, 2020 @09:01PM (#23278827)
Compared to the option of not converting, it would help everyone, reducing annoyance.

Also I'm not sure if you can generalize from your one relative to 99% of users.

Re:Students are failing AP tests because the College Board c... by LordDragonfang on Saturday May 23, 2020 @04:46AM (#23281247)
While it may not be 99%, /r/talesfromtechsupport on reddit has enough instances of this to suggest it is extremely common user behavior.
Re:Students are failing AP tests because the College Board c... by technion on Friday May 22, 2020 @02:54AM (#23269342)
Just to give credit where it's due here, I don't think I've ever seen a client side form check upload sizes before. I've had many frustrations going through a form upload then refreshing to a page that says "your file was too big".
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.

Re:Students are failing AP tests because the College Board c... by tripzilch on Friday May 22, 2020 @02:16PM (#23275188)
> The corruption problems came from students seeing that only PNGs/JPGs were allowed, then trying to "convert" the file just by renaming it.

I mean ... isn't that kind of a classic trick when handing in homework you didn't make? Just rename some file to .doc and claim it got corrupted?

Re:Students are failing AP tests because the College Board c... by shrimpx on Friday May 22, 2020 @12:59PM (#23274264)
File extensions have terrible usability. People changing the extension expecting something to be fixed is a classic misunderstanding. Many people do this every day, decades into personal computing.
Re:Students are failing AP tests because the College Board c... by tomtomtom1 on Friday May 22, 2020 @07:48AM (#23271075)
I don't understand why no one is blaming the education system?

How is it possible that students that are being considered for "advanced placement" are not familiar with file formats?

how horrible and backward your education system must be? This belongs to basic literacy in the modern world.

Note we're not speaking about old people who were exposed to files for the first time while they had to balance a family life and other responsibilities.

We're speaking about people that were forced to spend more than half of their lives learning !!!

Re:Students are failing AP tests because the College Board c... by smileysteve on Friday May 22, 2020 @09:26AM (#23271771)
Because in a world where apps do everything for you and 80% of your use is on a phone and the remaining 20% is either for a once a year use case, you don't need to worry about image formats.

Even as a software engineer, I haven't used a desktop or windows in 5 years. I haven't used TheGimp (or any other non web/app image manipulation software) in 3 years.

Re:Students are failing AP tests because the College Board c... by tomtomtom1 on Friday May 22, 2020 @04:52PM (#23276853)
that's interesting, so you use an iPad for your day to day programming?

from my experience converting ppt/word to pdf is a common enough use case that I would've assumed the majority of non-tech people run into it.

Latex is also a common case where you run into file extensions.

note I'm not expecting them to understand the difference between extensions, just what they mean and how to google how to convert between them.

Re:Students are failing AP tests because the College Board c... by ficklepickle on Friday May 22, 2020 @12:34PM (#23273920)
They don't learn any critical thinking skills. Memorization != learning.