Make WordPress Core

Opened 13 years ago

Closed 7 years ago

Last modified 7 years ago

#14244 closed defect (bug) (fixed)

Upload file types should be checked BEFORE uploading.

Reported by: ipstenu's profile ipstenu Owned by: ocean90's profile ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch needs-testing
Focuses: Cc:


Wanna get frustrated? Try uploading a 50 meg video and realizing you forgot to set your Upload file types to allow m4v.

Is there any way this can be checked BEFORE the file gets uploaded? As it stands today, you upload THEN it checks and deletes. Arg :)

Attachments (1)

14244.diff (2.0 KB) - added by polevaultweb 7 years ago.

Download all attachments as: .zip

Change History (14)

#1 @nacin
13 years ago

  • Component changed from General to Media
  • Milestone changed from Awaiting Review to Future Release

#2 @markoheijnen
11 years ago

Is this still the case. I would say this is fixed by using Plupload?

#3 @Ipstenu
10 years ago

This is NOT fixed by Plupload and is still a problem today.

#4 @ericlewis
9 years ago

  • Keywords needs-patch added
  • Type changed from defect (bug) to enhancement

Yes, we can do something similar to the early image detection in the FilesAdded callback in wp.Uploader.

#5 @chriscct7
7 years ago

  • Type changed from enhancement to defect (bug)

If its not an allowable filetype, it seems more like a bug that it doesn't do this detection earlier

7 years ago

#6 @polevaultweb
7 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Patch added that tells plupload the allowed mime types, and throws the error early if the file upload is not allowed. To test, the file would need to be dragged and dropped onto uploader, as plupload restricts the selection of those file types with this implementation.

#7 @SergeyBiryukov
7 years ago

  • Milestone changed from Future Release to 4.6

This ticket was mentioned in Slack in #core-images by joemcgill. View the logs.

7 years ago

This ticket was mentioned in Slack in #core-images by joemcgill. View the logs.

7 years ago

#10 @ocean90
7 years ago

@azaozz Can you take a look at 14244.diff please?

#11 @ocean90
7 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 37727:

Media: Pass allowed file extensions to Plupload.

Plupload's mime_types filter ( allows us to inform a user about an unsupported file before the file gets uploaded.

Props polevaultweb.
Fixes #14244.

#12 @ocean90
7 years ago

In 37728:

Media: Use the correct variable for the file object.

See #14244.

This ticket was mentioned in Slack in #core by drew. View the logs.

7 years ago

Note: See TracTickets for help on using tickets.