So I managed to write a peice of code that allows me to upload a zip file, im not even sure where it gets uploaded too, and I am doing it on my localhost with apache in control (www-data). the code is as follows:
public function upload_file(array $file){
add_filter('upload_mimes', array($this, accepted_mime_type));
if(wp_handle_upload($file, array('test_form' => false))){
var_dump(wp_handle_upload($file, array('test_form' => false)));
}else{
$this->error('Oops!', 'Something went wrong with the upload. Please try again.');
}
}
the error I get is: Specified file failed upload test
Im not sure whats going on, this is localhost.
The error you are seeing is coming from
wp_handle_upload()
:I am not sure about your context, but what you are trying to do seems to not be POST upload and as such fails
is_uploaded_file()
check.