-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File block - Can't upload .zip file using Upload button but can using Media Library link #23510
Comments
@bobbingwide Hey there! Thanks for reporting this. I tried to replicate on my end using Gutenberg 8.4.0, WordPress 5.4.2, and the TwentyTwenty theme. Here's a video where I used a zip of a previous Gutenberg version as a test with the file block: https://cloudup.com/cL1oapNsrcS Generally speaking, this is likely related to other security measures on your site and not Gutenberg. For example, here's a guide that walks you through how to resolve this: https://www.elegantthemes.com/blog/wordpress/how-to-fix-the-sorry-this-file-type-is-not-permitted-for-security-reasons-error-in-wordpress If you believe this is Gutenberg specific though, please do re-open this issue! For now, I'm going to close this out. |
I'm running the code locally in my Windows development environment. var _wpPluploadSettings = {"defaults":{"file_data_name":"async-upload","url":"/wp54/wp-admin/async-upload.php","filters":{"max_file_size":"26214400b","mime_types":[{"extensions":"jpg,jpeg,jpe,gif,png,bmp,tiff,tif,ico,asf,asx,wmv,wmx,wm,avi,divx,flv,mov,qt,mpeg,mpg,mpe,mp4,m4v,ogv,webm,mkv,3gp,3gpp,3g2,3gp2,txt,asc,c,cc,h,srt,csv,tsv,ics,rtx,css,htm,html,vtt,dfxp,mp3,m4a,m4b,aac,ra,ram,wav,ogg,oga,flac,mid,midi,wma,wax,mka,rtf,js,pdf,class,tar,zip,gz,gzip,rar,7z,psd,xcf,doc,pot,pps,ppt,wri,xla,xls,xlt,xlw,mdb,mpp,docx,docm,dotx,dotm,xlsx,xlsm,xlsb,xltx,xltm,xlam,pptx,pptm,ppsx,ppsm,potx,potm,ppam,sldx,sldm,onetoc,onetoc2,onetmp,onepkg,oxps,xps,odt,odp,ods,odg,odc,odb,odf,wp,wpd,key,numbers,pages"}]},"multipart_params":{"action":"upload-attachment","_wpnonce":"b46a1bd832"}},"browser":{"mobile":false,"supported":true},"limitExceeded":false}; as you can see zip is listed in the file types. I don't see any request going to the server. The video explains how to allow file types that can't be uploaded using other methods. In my case 'zip' is already supported. I use the upload from the Media Library. @annezazu. Please re-open the issue until an explanation has been found. I don't believe I have the authority to re-open the issue. |
In the editor, when I view source, the
The zip entry is the last one listed when I view I don't have a problem uploading a .gz file |
I tried hacking core ( wp-includes/functions.php ) to add
to the array in wp_get_mime_types(). And it worked. So my guess is it's Gutenberg revealing a previously unhandled limitation of WordPress core. I've found a TRAC that reports the problem similarly. |
@bobbingwide thanks for following up here with more information :) I've reopened and will add the label for needs-testing so someone else can try to replicate the issue at hand. Can you confirm you've tested this with Gutenberg 8.4 as well? |
Tested with Gutenberg 8.4.0 as well. In my opinion the most sensible fix would be in WordPress core. See TRAC 40175. |
@bobbingwide circling back on this -- I've changed this from needs testing to a Core Bug as I agree that this would be best fixed by the trac issue you referenced. Thanks so much for your thorough reporting and digging in ❤️. I learned something new just following along! |
|
Doesn't look like it's solved. Both with and without the Gutenberg plugin (8.8.0) installed, I get the same error while on windows. |
The problem hasn't been addressed in Gutenberg 8.9.1 nor has it been fixed in WordPress core. This issue should be re-opened while the problem still occurs. |
The error is still occurring with the latest WP version 5.5.1 (native Gutenberg). |
Reopening. It sounds like this is a windows-specific issue? |
yes, i can confirm it happens on Windows in any browser, but not on Linux. (Didn't test on mac) |
my client is having the same issue (native gb, wp 5.5.3). i work on a mac, no issues, but he is most certainly on a windows machine and issued, that he cannot upload zip files. i thought it was a role issue (me admin, him editor), but testing this on my machine with role editor: no problems. |
I came here to report the same problem and found this existing report. I created a new blank site to reproduce the issue.
|
Hello. Do we have any progress here or a possible solution or workaround? Newly risen tickets (like mine #33187) are being closed linking to this one. But I see nothing happening here for past 8 months. The core report here suggests / claims that this is WP Core problem, but linked Trac ticket is not touched for past 4 months. Am I missing something or does this mean that this problem is unsolved for four / half a year and there is nothing we can do to enable .zip uploading to Wordpress through File block? |
I have the similar problem. WP 5.7.2 |
This can be easily solved with something like this: |
@rjcalifornia Thanks for your support and the development of a "fix" plugin. But rather than installing another plugin, I'd like to see this added to Wordpress / Gutenberg since this is a pure bug (I don't think that plugins are meant to fix plugins). Any chance you can participate in writing a pull-request to any of corresponding tickets / report to get this solved in core code? |
I agree.
Sure, I'll submit one and hopefully it will be in the next release. |
I suggested your plugin to a user in this WP forum https://wordpress.org/support/topic/uploading-file-not-working-zip-rar/#post-15470118 |
I want to upload zip files and for me not helped: WP Add Mime Types and File Upload Types by WPForms plugins. Not helped adding line to wp-config: define('ALLOW_UNFILTERED_UPLOADS', true); But Helped: https://github.com/rjcalifornia/fixzip_upload |
Is there any solution in the block editor of 6.3.x? |
I have a similar problem with |
Describe the bug
In my site oik-plugins.com I support the uploading of
.zip files
- downloadable plugins and themes.For a long time now I've not been able to upload
.zip
files directly using the Media button of the File block.I get the message: Sorry, this file type is not permitted for security reasons.
The workaround is to use the Media Library button and upload the file that way.
Q. What do I need to do to enable the upload directly?
To reproduce
Steps to reproduce the behavior:
Expected behavior
.zip file should be accepted using the Upload button.
Updated to reflect my comments from July 1st.
Screenshots
If applicable, add screenshots to help explain your problem.
Editor version (please complete the following information):
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: