Page MenuHomePhabricator

Show warning when hash identical file exists
Closed, ResolvedPublic

Description

Show a warning, when a file with the same SHA1 hash already exists.


Version: unspecified
Severity: enhancement

Details

Reference
bz13434

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:06 PM
bzimport set Reference to bz13434.
bzimport added a subscriber: Unknown Object (MLST).

thomasV1 wrote:

I guess it should be possible to compute the hash on the client, using javascript.
If the image is a dupe, one would would avoid uploading the image and thus save bandwidth.

Bryan.TongMinh wrote:

I don't think JavaScript has access to local files?

(In reply to comment #2)

I don't think JavaScript has access to local files?

Not without ActiveX, which is evil.

Nope, can't calc the hash client-side. Would have to upload it to the server, then display a warning there. A bit annoying. :)

Just for the record, I just tested this by re-uploading an image I had already uploaded to commons (which is running r36279 atm) and I did get the warning when trying to upload it to the same dest filename (i.e., I got both the filename dupe message and the image dupe msg each with its own entry in a bulleted list). However, when trying to upload to a different name, I got no warning, and was taken directly to the image page, and /there/ a message appears referring to the duplicate file.

Does this have anything to do with the fact that I had js disabled during upload (the new js-enhanced form bothers me a bit)? In any case, it shouldn't since I get a same-filename warning with js off, so this should work too. Perhaps the bug should be reopened?

No warning will be displayed if you have checked "ignore warnings".

No JavaScript is involved.

I just confirmed that I do receive the warning ("This file is a duplicate of the following file:" plus the thumbnail) when uploading a duplicate copy of http://commons.wikimedia.org/wiki/Image:Wikipedia-logo-gan.png as "Image reupload test file.png", with all text fields on the form filled with "xxx", GFDL selected as license, and nothing else altered.

Tested on Commons, logged in as sysop, English UI, in Firefox 3.0 release candidate on Mac.

Ah, just tried again, and figured what happened. When you get to the page with the pre-upload warnings, if you choose to return to the upload form, the "ignore warnings" checkbox is automatically checked, even though it wasn't before (otherwise you wouldn't see the warnings in the first place). I don't know why that happens, it doesn't make sense to me. It would if the option was stored permanently, but it's not. And in that specific case if you originally wanted to ignore the warnings you wouldn't have returned to the upload form, but rather continued with the upload.

Perhaps I should file a new bug for this (usability?) problem...

(In reply to comment #8)

Ah, just tried again, and figured what happened. When you get to the page with
the pre-upload warnings, if you choose to return to the upload form, the
"ignore warnings" checkbox is automatically checked, even though it wasn't
before (otherwise you wouldn't see the warnings in the first place). I don't
know why that happens, it doesn't make sense to me. It would if the option was
stored permanently, but it's not. And in that specific case if you originally
wanted to ignore the warnings you wouldn't have returned to the upload form,
but rather continued with the upload.

Perhaps I should file a new bug for this (usability?) problem...

This was bug 14551. Fixed with r36318 today.