• Kommiku 2.3 support Batch upload using file uploader . ??

    Test it on LOCALHOST before using on Website

    Here is whole code ??

    <style>
    .ajax-file-upload-statusbar{border:1px solid #0ba1b5;margin-top:10px;width:400px;
    margin-right:10px;margin:5px;-moz-border-radius:4px;-webkit-border-radius:4px;
    border-radius:4px;padding:5px 5px 5px 5px}.ajax-file-upload-filename{width:100%;height:auto;
    margin:0 5px 5px 10px;color:#807579}
    .ajax-file-upload-progress{margin:0 10px 5px 10px;position:relative;width:250px;border:1px solid #000;padding:1px;
    border-radius:3px;display:inline-block}
    .ajax-file-upload-bar{background-color:#38B63C;width:0;height:20px;border-radius:3px}
    .ajax-file-upload-percent{position:absolute;display:inline-block;top:3px;left:48%}
    .ajax-file-upload-red{-moz-box-shadow:inset 0 39px 0 -24px #e67a73;-webkit-box-shadow:inset 0 39px 0 -24px #e67a73;
    box-shadow:inset 0 39px 0 -24px #e67a73;background-color:#e4685d;-moz-border-radius:4px;-webkit-border-radius:4px;
    border-radius:4px;display:inline-block;color:#fff;font-family:arial;font-size:13px;
    font-weight:normal;padding:4px 15px;text-decoration:none;text-shadow:0 1px 0 #b23e35;cursor:pointer;vertical-align:top}
    .ajax-file-upload-green{background-color:#38B63C;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;margin:0;
    padding:0;display:inline-block;color:#fff;font-family:arial;font-size:13px;font-weight:normal;padding:4px 15px;
    text-decoration:none;cursor:pointer;text-shadow:0 1px 0 #5b8a3c;vertical-align:top}
    .ajax-file-upload{display:inline-block;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#599bdc),color-stop(100%,#3072b3));background:-moz-linear-gradient(center top,#599bdc 0,#3072b3 100%);-webkit-box-shadow:0 1px 0 0 #7dc0ff inset,0 -1px 0 0 #1a3d5e inset,0 2px 2px 0 #d4d4d4;-moz-box-shadow:0 1px 0 0 #7dc0ff inset,0 -1px 0 0 #1a3d5e inset,0 2px 2px 0 #d4d4d4;box-shadow:0 1px 0 0 #7dc0ff inset,0 -1px 0 0 #1a3d5e inset,0 2px 2px 0 #d4d4d4;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;text-shadow:0 1px 0 #424242;padding:10px 20px;border-color:#295c8c;border-width:1px;border-style:solid;font-family:Lucida Grande;font-size:14px;color:#fff;cursor:pointer;width:100px}
    .ajax-file-upload:hover{background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#82bbf0),color-stop(100%,#3072b3));background:-moz-linear-gradient(center top,#82bbf0 0,#3072b3 100%)}
    </style>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="/uploader/jquery.uploadfile.min.js"></script>
    <div id="mulitplefileuploader">Upload</div>
    
    <div id="status"></div>
    <?php
    
    //If directory doesnot exists create it.
    $output_dir = UPLOAD_FOLDER.$chapter['folder'];
    
    if(isset($_FILES["myfile"]))
    {
    	$ret = array();
    
    	$error =$_FILES["myfile"]["error"];
       {
    
        	if(!is_array($_FILES["myfile"]['name'])) //single file
        	{
           	 	$fileName = $_FILES["myfile"]["name"];
           	 	move_uploaded_file($_FILES["myfile"]["tmp_name"],$output_dir. $_FILES["myfile"]["name"]);
           	 	 //echo "<br> Error: ".$_FILES["myfile"]["error"];
    
    	       	 	 $ret[$fileName]= $output_dir.$fileName;
        	}
        	else
        	{
    $i = count($page_list);
    foreach ($_FILES["myfile"]["error"] as $key => $error) {
    $i++;
    if ($error == UPLOAD_ERR_OK) {
    $tmp_name = $_FILES["myfile"]["tmp_name"][$key];
    $name = $_FILES["myfile"]["name"][$key];
    move_uploaded_file($tmp_name, "$output_dir/$name");
    
    $db->page_create('',$i,$name,$pubdate,'',$i,$series['id'],$chapter["id"],'');
    }
    }
    }
    }
    echo json_encode($ret);
    }
    
    ?>
    <script>
    
    $(document).ready(function()
    {
    
    var settings = {
    
    	method: "POST",
    	allowedTypes:"jpg,png,gif,doc,pdf,zip",
    	fileName: "myfile",
    	multiple: true,
    	uploadButtonClass:"ajax-file-upload-green",
    	onSuccess:function(files,data,xhr)
    	{
    		$("#status").html("<font color='green'>Upload is success</font>");
    
    	},
    	onError: function(files,status,errMsg)
    	{
    		$("#status").html("<font color='red'>Upload is Failed</font>");
    	}
    }
    $("#mulitplefileuploader").uploadFile(settings);
    
    });
    </script>

    https://www.ads-software.com/plugins/kommiku/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple Page Uploading’ is closed to new replies.