2 Replies - 3919 Views - Last Post: 21 August 2012 - 08:43 PM

#1 iheartbreakz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 196
  • Joined: 27-April 11

Upload the whole fIle queue at once

Posted 19 August 2012 - 03:04 PM

my problem is that the file queue gets uploaded one by one.. is there any way that it starts uploading all at the same time?

<script type="text/javascript">
$(function(){
	$('#swfupload-control').swfupload({
		upload_url: "upload.php?do=verify&method=flash",
		file_post_name: 'upfile',
		file_size_limit : "<? echo ($maxfilesize * 1024); ?>",
		file_types : "<? echo $file_types; ?>",
		file_types_description : "File Types",
		file_upload_limit : 25000,
		flash_url : "js/swfupload/swfupload.swf",
		button_image_url : 'js/swfupload/wdp_buttons_upload_114x29.png',
		button_width : 819,
		button_height : 83,
		button_placeholder : $('#button')[0],
		debug: false
	})
		.bind('fileQueued', function(event, file){
			var listitem='<span class="status" ></span>'+
			'<div class="progressWrapper" id="'+file.id+'" >'+
			'<div class="upProgFileName">'+
				''+file.name+''+
				'</div>'+
				'<div class="upProgBarBackground"><div class="upProgBar"></div><div class="upProgBarText"></div></div>'+
				'<div class="upProgCancelWrapper">'+
				'<img class="upProgCancel" src="/js/swfupload/cancel.png" alt="Cancel"/>'+
				'</div>'+
				'</div>';
			$('#log').append(listitem);
			$('div#'+file.id+' .upProgCancel').bind('click', function(){
				var swfu = $.swfupload.getInstance('#swfupload-control');
				swfu.cancelUpload(file.id);
				$('div#'+file.id).slideUp('fast');
			});
			// start the upload since it's queued
	// Here are some POST values to send. Thes
				var swfu = $.swfupload.getInstance('#swfupload-control');
swfu.addPostParam("usercheck", $("input#usercheck").val());
swfu.addPostParam("passcheck", $("input#passcheck").val());
			$(this).swfupload('startUpload');

		})
		.bind('fileQueueError', function(event, file, errorCode, message){
			alert('Size of the file '+file.name+' is greater than limit');
		})
		.bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){
			$('#queuestatus').text('Files Selected: '+numFilesSelected+' / Queued Files: '+numFilesQueued);
		})
		.bind('uploadStart', function(event, file){
			$('.blockhdr724c').show();
			$('div#'+file.id).find('div.progressvalue').text('0%');
			$('div#'+file.id).find('div.upProgCancel').show();
		})
		.bind('uploadProgress', function(event, file, bytesLoaded){
			//Show Progress
			var percentage=Math.round((bytesLoaded/file.size)*100);
			$('div#'+file.id).find('div.upProgBar').css('width', percentage+'%');
			$('div#'+file.id).find('div.upProgBarText').text(percentage+'%');
		})
		.bind('uploadSuccess', function(event, file, serverData){
			
			var item=$('div#'+file.id);
			item.find('div.upProgBar').css('width', '100%');
			item.find('div.upProgBarText').text('100%');
			var pathtofile='<a href="/'+file.name+'" target="_blank" >view &raquo;</a>';
			$('span.status').html(serverData);
			$('.progressWrapper').hide();


		})
		.bind('uploadComplete', function(event, file){
			// upload has completed, try the next one in the queue
			$(this).swfupload('startUpload');
		})
	
});


Is This A Good Question/Topic? 0
  • +

Replies To: Upload the whole fIle queue at once

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10488
  • View blog
  • Posts: 38,868
  • Joined: 27-December 08

Re: Upload the whole fIle queue at once

Posted 21 August 2012 - 10:54 AM

Since you solved your problem (from your report), would you mind sharing your solution? :)
Was This Post Helpful? 0
  • +
  • -

#3 iheartbreakz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 196
  • Joined: 27-April 11

Re: Upload the whole fIle queue at once

Posted 21 August 2012 - 08:43 PM

updated the script to the latest one so didn't need this script
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1