• Resolved Hyrules

    (@hyrules)


    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 ==> 5727179

    Server compatibility show every box with a green checkbox and no special comments.

    Thanks in advance for the help.

Viewing 15 replies - 1 through 15 (of 40 total)
  • Plugin Author bhaldie

    (@bhaldie)

    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).
    Thread Starter Hyrules

    (@hyrules)

    upload_max_filesize = 100M
    post_max_size = 100M
    memory_limit = 512M

    upload_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

    Plugin Author bhaldie

    (@bhaldie)

    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;
    
    Thread Starter Hyrules

    (@hyrules)

    Tried it. It created an empty folder in the /tmp.

    Plugin Author bhaldie

    (@bhaldie)

    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?

    Thread Starter Hyrules

    (@hyrules)

    I’m on centos 6 x64 server hosted on iWeb. I have WHM and CPanel installed. I have full control on the server.

    Plugin Author bhaldie

    (@bhaldie)

    Consider adding the following lines to your apache configuration file:

    AddType application/zip zip
    AddType application/zip ZIP

    Thread Starter Hyrules

    (@hyrules)

    Actually 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.

    Plugin Author bhaldie

    (@bhaldie)

    ill test with chrome right now see if a get the same results.

    Thread Starter Hyrules

    (@hyrules)

    Also I have this in chrome after uploading files :

    Plugin Author bhaldie

    (@bhaldie)

    just tested with chrome version Version 53.0.2785.143 (64-bit) on a mac no issue ??

    Plugin Author bhaldie

    (@bhaldie)

    does the screenshot happened everytime you upload a single file or is this using the batch process

    Thread Starter Hyrules

    (@hyrules)

    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 :

    https://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 8 years, 1 month ago by Hyrules.
    Plugin Author bhaldie

    (@bhaldie)

    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.

    Thread Starter Hyrules

    (@hyrules)

    Perfect. If you need anything tested just let me know. Thanks.

Viewing 15 replies - 1 through 15 (of 40 total)
  • The topic ‘Batch Upload’ is closed to new replies.