Heading says it all… have set the MIME to application/zip and tried on a fresh install, still getting red error “Expects or application/zip” even though I can choose a ZIP file when I click the Browse button.
I’m going to answer myself as I figured it out, sort of… I had to set the file size more than the zip file uploaded, otherwise I got a SECURITY red warning: Some uploaded files where rejected due to security validation. Once I set the Max File size in form settings to like 100MB all was fine. Also it now only works when direct-upload to server option is selected, I still get this error with the option not selected and use the standard file settings. So there is a bug!
I have set the filter in snippets to:
add_filter( ‘bricksforge/pro_forms/allowed_file_types’, function( $allowed_file_types ) {
// All known ZIP MIME types
$allowed_file_types[] = 'application/zip';
$allowed_file_types[] = 'application/x-zip-compressed';
$allowed_file_types[] = 'application/zip-compressed';
$allowed_file_types[] = 'application/x-zip';
$allowed_file_types[] = 'multipart/x-zip';
$allowed_file_types[] = 'application/octet-stream'; // sometimes reported for ZIPs
return $allowed_file_types;
});
Also if I use the “direct-upload to server” upload option for the files (jpg), the files are not saved to the submission entry. If I use the standard, the file path get’s saved to submissions. So that’s a second bug!
Could you try it again with 3.1.6? ![]()
Thanks for this, but I don’t get it to work. This is what I got.
I have the “add_filter” with all the zip files added with my snippet. (per my previous post)
If I have Direct Upload to Server activated:
- png and jpg files upload just fine BUT they don’t show up in submission fields.
- If I add ZIP file to the file field, it uploads straight away, the upload field shows % and turns green, but when I hit the submit button I get the red security notification: Some uploaded files where rejected due to security validation.
If I deactivate the direct upload option, I also get the red error when clicking the submit button on ZIP files, JPG and PNG files work just fine and the link is added to the submissions.
The ZIP file upload works just fine with the standard Bricks Form file field, so it must be Bricksforge. It’s a local install with no other plugins other than JetEngine and Bricks theme.
Thanks.
Strange, every test you described works on my side - even without using the php filter. Could you try to clear the cache?
Nothing for me, if it’s my error I can’t figure it out. I wouldn’t be surprised if there is some other settings option I need to toggle, like with the file size.
The Direct File upload option actually uploads the file to server to the tmp folder, it’s right there and i can see it, but when i click submit form, I get this error and nothing happens.
Okey, for whatever reason, if i deleted my current ProForm from the page, save it and then created it again from scratch now it worked. So all good and was my error! Appreciate the patience!