Replies: 0
Hi,
I’m trying to upload .rar file but I get an error. (ZIP files work good) The file exists and permissions are correct.
“Error offloading /var/www/server/wp-content/uploads/2021/09/xg_Pack_1.2.rar to provider: Found 1 error while validating the input provided for the PutObject operation: [ContentType] must be a string or an object that implements __toString(). Found bool(false)”
Uploading like this:
global $as3cf;
$upl = $as3cf->upload_attachment($attachment->ID);
function my_theme_custom_upload_mimes( $existing_mimes ) { // allow rar uploads
$existing_mimes['rar'] = 'application/rar';
$existing_mimes['scs'] = 'application/zip';
$existing_mimes['package'] = 'application/octet-stream';
return $existing_mimes;
}
add_filter( 'upload_mimes', 'my_theme_custom_upload_mimes', 99);
add_filter( 'as3cf_allowed_mime_types', 'my_theme_custom_upload_mimes', 101);