WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 4 years ago

Last modified 3 years ago

#14244 closed defect (bug) (fixed)

Upload file types should be checked BEFORE uploading.

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

Description

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 4 years ago.

Download all attachments as: .zip

Change History (14)

#1 @nacin
9 years ago

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

#2 @markoheijnen
7 years ago

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

#3 @Ipstenu
7 years ago

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

#4 @ericlewis
6 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
4 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

@polevaultweb
4 years ago

#6 @polevaultweb
4 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
4 years ago

  • Milestone changed from Future Release to 4.6

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


4 years ago

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


4 years ago

#10 @ocean90
4 years ago

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

#11 @ocean90
4 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 (http://www.plupload.com/docs/Options#filters.mime_types) allows us to inform a user about an unsupported file before the file gets uploaded.

Props polevaultweb.
Fixes #14244.

#12 @ocean90
4 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.


3 years ago

Note: See TracTickets for help on using tickets.