Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

file upload with progress bar

<script src="js/code_js.js" type="text/javascript"></script> <script src="js/code_js1.js" type="text/javascript"></script> <script type="text/javascript">$(document).ready(function() { 	 $('#upload_container').submit(function(e) {			if($('#userImage').val()) {			e.preventDefault();			$('#loader-icon').show();			$(this).ajaxSubmit({ 				target:   '#targetLayer', 				beforeSubmit: function() {				  $("#progress-bar").width('0%');				},				uploadProgress: function (event, position, total, percentComplete){						$("#progress-bar").width(percentComplete + '%');					$("#progress-bar").html('<div id="progress-status">' + percentComplete +' %</div>')				},				success:function (){					$('#loader-icon').hide();				},				resetForm: true 			}); 			return false; 		}	});}); </script>
Source by www.sourcecodester.com #
 
PREVIOUS NEXT
Tagged: #file #upload #progress #bar
ADD COMMENT
Topic
Name
5+2 =