←back to thread

669 points danso | 1 comments | | HN request time: 0s | source
Show context
braythwayt ◴[] No.23267590[source]
A lot of comments are arguing about whether the software should have been modified to accept the HEIC format.

Let's go with "no" for the sake of argument. They probably can't accept an mp3 of me singing my answers, either. But!

If I upload an HEIC, an mp3, a keynote file, or anything else unacceptable... Why doesn't the site provide an immediate "File format not accepted, please upload .gif, .jpg, or .png" message?

According to the article, the software would actually just hang. I think there's room to argue about whether they need to support the default format of an extremely significant platform for students. I think there's room to argue whether they should know enough about INPUT tags to let the browser help with this.

But while we're arguing about those questions, can't we all agree that simply hanging without providing a useful error message, and without giving the student an opportunity to re-upload their image... Is unacceptably poor software design for an institution that holds people's future in their hands?

I don't know about you, but if I were an American college student, I'd now be wondering what else they have kind of slapped together without thinking through graceful error handling?

replies(5): >>23267911 #>>23268087 #>>23268156 #>>23269685 #>>23270629 #
treesprite82 ◴[] No.23267911[source]
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.

replies(5): >>23268095 #>>23268124 #>>23271075 #>>23274264 #>>23275188 #
LeifCarrotson ◴[] No.23268124[source]
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).
replies(3): >>23268189 #>>23268244 #>>23269342 #
askvictor ◴[] No.23268244[source]
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.

replies(1): >>23268346 #
1. Wowfunhappy ◴[] No.23268346{3}[source]
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.