Page MenuHomePhabricator

UploadWizard does not handle invalid names
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. go to file step
  2. upload a file with no extension

Expected result: error message about file name, or (preferably) auto-correct
Actual result: no visible effect, JS error about this.title being null on mw.UploadWizardUpload.js line 446

Event Timeline

Tgr created this task.Feb 18 2015, 4:25 AM
Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: UploadWizard.
Tgr added a subscriber: Tgr.
Restricted Application added a project: Multimedia. · View Herald TranscriptFeb 18 2015, 4:25 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Gilles added a subscriber: Gilles.Feb 18 2015, 8:09 AM

Files without an extension are perfectly valid in some operating systems.

I actually can't repro on master with a JPG lacking an extension (OS X/firefox). It uploads fine and UW seems to add the extension in the UI.

Maybe in your case it's the combination of unsupported MIME type and lack of extension? What kind of file were you uploading?

Tgr added a comment.Feb 18 2015, 8:36 AM

Attached the test file I was using (with master). It's the one generated by the chunked upload browser test.

Tgr added a comment.Feb 18 2015, 8:37 AM

Invisible pixel is invisible... F42903

Can you upload it somewhere else? I can't find a way to download and save the actual image in phabricator, I keep getting an HTML error served instead.

I did reproduce your issue, however, by picking a text file with no extension.

I can't find a way to download and save the actual image in phabricator, I keep getting an HTML error served instead.

@Gilles: F42903 , "View File", "Save" in your browser? Works in Firefox. Chrome might be broken and invalidate the token by reloading...

Look at what it actually saves, the contents of the file is the HTML of an expired token error page.

@Gilles: Not here, it's a valid PNG with my steps above in FF.

Can either of you just email it to me? :)

Tgr added a comment.Feb 18 2015, 6:36 PM

Right click on view file and select save. (T87083)

That works, thanks. I think that the issue is what I expected: OS X's mime detection thinks this is a text file. Linux's mime detection probably does the same. Therefore, it behaves like an extension-less text file on upload. I imagine that the way crunchy generates it is throwing off the mime regexps.

So I think that it's smaller bug than expected. Extension-less images that are correctly mime-detected (which would be the vast majority) seem to work fine in UW.

Gilles triaged this task as Low priority.Feb 19 2015, 8:30 AM

Change 235363 had a related patch set uploaded (by Bartosz Dziewoński):
Correctly report an error for file names without extension

https://gerrit.wikimedia.org/r/235363

Change 235363 merged by jenkins-bot:
Correctly report an error for file names without extension

https://gerrit.wikimedia.org/r/235363

matmarex closed this task as Resolved.Sep 2 2015, 9:12 PM
Jdforrester-WMF moved this task from Untriaged to Done on the Multimedia board.Sep 11 2015, 6:12 PM