Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have create multiple file upload using ajax and jquery. i want to have a progress bar. but i dont know how , who can help me in this way?
Posted

Its not PHP solution, Javascript. Try the below, you can modify it properly to use
HTML
<HTML>
<style>
</style>
<SCRIPT>
function Slide(holder, width, height, SlideCount)//width and height in pixel
{
	var topDiv=document.createElement("DIV");
	topDiv.style.height=height;
	var currentPos=0;
	holder.appendChild(topDiv);
	
	var Child1=document.createElement("DIV");
	Child1.style.width=0;
	Child1.style.height=height;
	Child1.style.border="1px solid red";
	Child1.style.background="red";
	Child1.style.float="left";
	topDiv.appendChild(Child1);
	
	var Child2=document.createElement("DIV");
	Child2.style.width=width;
	Child2.style.height=height;
	Child2.style.border="1px solid red";
	Child2.style.float="left";
	topDiv.appendChild(Child2);
	holder.appendChild(topDiv);
	return {
		SetPosition:function(count){
			if(count>SlideCount)
			{
				count=SlideCount;
			}
			else if(count<0)
				count=0;
			currentPos=count;
			var left=Math.round(count*(width/SlideCount));
			var right=width-left;
			Child1.style.width=left;
			Child2.style.width=right;
		},
		GetPosition:function(){
			return currentPos;
		}
	}
}
var cross;
window.onload=function()
{
	cross=Slide(document.querySelector("body"),200, 10, 100);
	cross.SetPosition(0);
}
</SCRIPT>
<BODY>
<INPUT onclick="cross.SetPosition(cross.GetPosition()+1);" type='button' value="++">
<INPUT onclick="cross.SetPosition(cross.GetPosition()-1)" type='button' value="--">
</BODY>
</HTML>
 
Share this answer
 
v2
PHP has nothing to do here. What you need to do is using XHRv2, which has an event that reports the progress of a file upload.

You'll find more information here http://www.html5rocks.com/en/tutorials/file/xhr2/[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900