File "code.html"

Full Path: /home/analogde/www/Design/fileman/Fusion/upload_file/0011/code.html
File size: 1.29 KB
MIME-type: text/html
Charset: utf-8

<!DOCTYPE html>
 
<html>
	<head>
		<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
		<script src="//oss.maxcdn.com/jquery.form/3.50/jquery.form.min.js"></script>
		<link rel='stylesheet' href='style.css' />
	</head>
	<body>
 
		<div class='formarea'>
			<h2>File Upload Progress Bar Example</h2>
			<form method='post' action='upload.php' enctype='multipart/form-data'>
				<input type='file' name='file' />
				<button>Upload</button>
			</form>
			<div id="bararea">
				<div id="bar"></div>
			</div>
			<div id='percent'></div>
			<div id='status'></div>
		</div>
		
		
		<script>
		
			$(function() {
				$(document).ready(function(){
					var bar = $('#bar')
					var percent = $('#percent');
					var status = $('#status');
					
					$('form').ajaxForm({
							beforeSend: function() {
							status.empty();
							var percentVal = '0%';
							bar.width(percentVal);
							percent.html(percentVal);
						},
							uploadProgress: function(event, position, total, percentComplete) {
							var percentVal = percentComplete + '%';
							percent.html(percentVal);
							bar.width(percentVal);
						},
							complete: function(xhr) {
							status.html(xhr.responseText);
						}
					});
				});
			});
		</script>
	</body>
</html>