Mdocs file upload functionality has been alter since version 3.4, meaning something has changed on your server, any new plugins added or have you changed your theme.
Alos please indicate what server you are using…. e.g. windows iss version xxx, apache version xxx, php version xxx.
Alos make sure you have the right permission to access the following folders:
- system temp directory
- uploads directory for wordpress
- mdocs directory under the uploads directory
My theme did get updated actually, and it had something to do with the database as well, sorry I forgot about that.
This is for a work site, I will try tonight on a personnel site at home to see if its something to do with my network and being blocked and come back to you tomorrow. Thank you for all your help so far.
Sounds good, and no problem at all. These issues are the hardest to debug I just have to keep crossing off potential issue. Hope we can find a solution 🙂
I really like the plug in, so would like to be able to fix it.
I did the file system clean up which has now allowed me to upload single files like I did before, but I still can’t upload a zip file, still the same error message.
Did you get a chance to try the batch upload on your personal server, and if so did it work there?
So when Uploading a zip file using batch upload option
file is uploaded to site and is found in c:\windows\temp
file is called phpxxxx.tmp and file size is same.
renaming this file to .zip and the contents are visible
Error Message in wp
Memphis Error: The zip file you are trying to upload does not contain any files, or is not a zip file. Please try again with a different file.
I’m
OS Windows 2012 R2
IIS 8.5
Php 5.6
I’m stump to a solution…. one last thing we could try is to remove the fail condition in the batch upload and see what happens.
if you want you can try this, open the file docs-batch-upload.php and comment on line 62:
//if($zip_result != null && isset($zip_result['file'])) {
and line 107 to 124 change it to this:
/*else {
mdocs_errors(__('The zip file you are trying to upload does not contain any files, or is not a zip file. Please try again with a different file.', 'memphis-documents-library'), 'error');
mdocs_rmdir(sys_get_temp_dir().'/mdocs-import');
?>
<br>
<form class="mdocs-uploader-form" enctype="multipart/form-data" action="<?php echo get_site_url().'/wp-admin/admin.php?page='.$post_page.'&mdocs-cat='.$post_cat; ?>" method="POST">
<label><?php _e('Default Folder','memphis-documents-library'); ?>:
<select name="mdocs[cat]">
<?php mdocs_display_folder_options_menu($cats, $current_cat); ?>
</select>
</label><br><br>
<input type="file" name="mdocs-batch" /><br>
<input type="submit" class="button button-primary" value="<?php _e('Upload Zip File','memphis-documents-library') ?>" /><br/>
</form>
</div>
</div>
<?php
}*/
So I don’t get an error anymore, and goes to the page where the complete button is but my files aren’t listed
Okay revert back to the normal state of the mdocs-batch-upload.php file. So the guess is that the zip function is not working for some reason. Next I would like you to add this to the same file starting at line 26:
$zip_result = mdocs_unzip($_FILES['mdocs-batch']['tmp_name'], sys_get_temp_dir());
// will output the contents if anything of the zip file.
var_dump($zip_results);
// stops the application
die();
I just get a blank screen with null in the top left hand corner, after I’ve pressed upload.
-
This reply was modified 7 years, 4 months ago by laurengibb.
Revert the mdocs-batch-upload.php back to normal. Open the file mdocs-import.php, goto line 252 and add this:
$zip_result = false;
// will determine if the zip function is working.
var_dump($zip->open($zip_file));
// stop application
die();
I just get a blank screen with ‘int(11)’ in the top left hand corner, after I’ve pressed upload.
Revert:
goto line 270 and add this above it:
var_dump($zip_result);
die();
return $zip_result;
Just back to the original error message now :/