Batch Upload
-
Hi,
I’m trying to do a batch upload on memphis doc and i’m getting the following error :
Memphis Error:
Please upload a zip file.Output:
name ==> testfile.zip
type ==> application/octet-stream
tmp_name ==> /tmp/phpG79bjI
error ==> 0
size ==> 5727179Server compatibility show every box with a green checkbox and no special comments.
Thanks in advance for the help.
-
Make sure all these settings are correct as well:
- Check upload_tmp_dir in php.ini. This is directory where PHP stores temporary files while uploading.
- Check open_basedir in php.ini. If defined it limits PHP read/write rights to specified path and its subdirectories. Ensure that upload_tmp_dir is inside this path.
- Check post_max_size in php.ini. If you want to upload 20 Mbyte files, try something a little bigger, like post_max_size = 21M. This defines largest size of POST message which you are probably using during upload.
- Check upload_max_filesize in php.ini. This specifies biggest file that can be uploaded.
- Check memory_limit in php.ini. That’s the maximum amount of memory a script may consume. It’s quite obvious that it can’t be lower than upload size (to be honest I’m not quite sure about it-PHP is probably buffering while copying temporary files).
upload_max_filesize = 100M
post_max_size = 100M
memory_limit = 512Mupload_tmp_dir and open_basedir I have no control upon since i’m in a cpanel environment.
The file i’m trying to upload is 5mb
if you want to do a test you can try this, open the file mdocs-batch-upload.php and change starting at line 10:
if(isset($_FILES['mdocs-batch']) && strpos($_FILES['mdocs-batch']['type'],'zip') == false) { $string = '<h5>'.__('Please upload a zip file.','mdocs').'</h5>'; $string .= '<h6>'.__('Output:','mdocs').'</h6>'; foreach($_FILES['mdocs-batch'] as $index => $value) $string .= $index.' ==> '.$value.'<br>'; $string .= '</p>'; mdocs_errors($string, 'error'); } elseif(isset($_FILES['mdocs-batch']) && strpos($_FILES['mdocs-batch']['type'],'zip') >= 0) { if(!file_exists(sys_get_temp_dir().'/mdocs/')) mkdir(sys_get_temp_dir().'/mdocs/'); $zip_result = mdocs_unzip($_FILES['mdocs-batch']['tmp_name'], sys_get_temp_dir()); $do_zip = true; } elseif (isset($_POST['mdocs-batch-complete'])) { $do_complte = true; }to this:
/* if(isset($_FILES['mdocs-batch']) && strpos($_FILES['mdocs-batch']['type'],'zip') == false) { $string = '<h5>'.__('Please upload a zip file.','mdocs').'</h5>'; $string .= '<h6>'.__('Output:','mdocs').'</h6>'; foreach($_FILES['mdocs-batch'] as $index => $value) $string .= $index.' ==> '.$value.'<br>'; $string .= '</p>'; mdocs_errors($string, 'error'); } elseif(isset($_FILES['mdocs-batch']) && strpos($_FILES['mdocs-batch']['type'],'zip') >= 0) { if(!file_exists(sys_get_temp_dir().'/mdocs/')) mkdir(sys_get_temp_dir().'/mdocs/'); $zip_result = mdocs_unzip($_FILES['mdocs-batch']['tmp_name'], sys_get_temp_dir()); $do_zip = true; } elseif (isset($_POST['mdocs-batch-complete'])) { $do_complte = true; } */ if(!file_exists(sys_get_temp_dir().'/mdocs/')) mkdir(sys_get_temp_dir().'/mdocs/'); $zip_result = mdocs_unzip($_FILES['mdocs-batch']['tmp_name'], sys_get_temp_dir()); $do_zip = true;Tried it. It created an empty folder in the /tmp.
I think your problem is this application/octet-stream. Your server does not recognize zip files.
The MIME types “text/plain” and “application/octet-stream” are termed ambiguous because they generally do not provide clear indications of which application or CLSID should be associated as the content handler…
…and defaulting to the final determined MIME type of “application/octet-stream.” Other types of files, such as .reg files, behave similarly.
What type of server are you running? Windows or Linux?
I’m on centos 6 x64 server hosted on iWeb. I have WHM and CPanel installed. I have full control on the server.
Consider adding the following lines to your apache configuration file:
AddType application/zip zip
AddType application/zip ZIPActually just did a test and this is an issue with Chrome. I cannot reproduce this with Internet Explorer which seems to upload the files properly.
ill test with chrome right now see if a get the same results.
Also I have this in chrome after uploading files :
just tested with chrome version Version 53.0.2785.143 (64-bit) on a mac no issue 🙁
does the screenshot happened everytime you upload a single file or is this using the batch process
it’s directly when I click on memphis docs in the left menu. It’s every time.
For the other error the problem does not seem to happen on mac :
http://stackoverflow.com/questions/856013/mime-type-for-zip-file-in-google-chrome
Look at the answer of this post on stack overflow.
Also tried to disable my extensions in chrome but it’s still happening.
-
This reply was modified 9 years, 5 months ago by
Hyrules.
Yes I can reproduce the batch file upload error with chrome for windows, chrome on mac works fine….
as for the second issue still looking into it.
Perfect. If you need anything tested just let me know. Thanks.
The topic ‘Batch Upload’ is closed to new replies.