file upload with progress bar

Solutions on MaxInterview for file upload with progress bar by the best coders in the world

showing results for - "file upload with progress bar"
Florencia
30 Jun 2018
1 
2postFile('thumbnail' , 'progress-bar-thumbnail');
3
4
5//  "InputFile" & "ProgressBar" are ID of elements 
6function postFile(InputFile , ProgressBar) {
7            var formdata = new FormData();
8
9            formdata.append(InputFile, $('#'+InputFile)[0].files[0]);
10
11            let request = new XMLHttpRequest();
12
13            request.upload.addEventListener('progress', function (e) {
14                let file1Size = $('#'+InputFile)[0].files[0].size;
15
16                if (e.loaded <= file1Size) {
17                    let percent = Math.round(e.loaded / file1Size * 100);
18                    $('#'+ProgressBar).width(percent + '%').html(percent + '%');
19                }
20
21                if(e.loaded == e.total){
22                    $('#'+ProgressBar).width(100 + '%').html(100 + '%');
23                }
24            });
25
26  			// instead of '/admin/blog', write your form action
27            request.open('post', '/admin/blog');
28            request.timeout = 45000;
29            request.send(formdata);
30        }
Franco
01 May 2016
1<center><form id="upload_container" action="upload.php" method="post"><div><label>Upload Image File:</label><input name="userImage" id="userImage" type="file" class="demoInputBox" /></div><br /><div><input type="submit" id="btnSubmit" value="Submit" class="btnSubmit" /></div><div id="progress-div"><div id="progress-bar"></div></div><div id="targetLayer"></div></form><div id="loader-icon" style="display:none;"><img src="loading.gif" /></div></center>
Frieda
30 Nov 2018
1<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>
queries leading to this page
progress bar upload fileimage upload progress barajax file upload progress bar jquery phpprogress bar while uploading fileupload file get progressfile upload progress webfile uploading with progress barform progress uploadupload progress bar scriptprogress bar for image uploadupload file progress barprogress bar with percentage ajaxsubmitupload box with progress barprogress bar image upload jqueryupload file and get progress barhow to see uploading progress filrupload progress bar sscriptjquery on select file show progress barfile upload progress bar pluginhtml file upload progressbarfileupload progress barfileupload progressbar jqueryprogress bar file upload exampleprogress bar file upload code examplesfile upload with progress barjquery file upload progress bar percentagejavascript image upload progress barhow to make a file upload progress barselect file progress bar pluginprogress bar while uploadingajax file upload with progress barfile upload progress bar halfajax detect upload progressupload with progress barhow to render file upload progress barajax upload progressbar jqueryhow to track progress of file upload in javascriptwhen image is upload progress showfile upload progress barhtml progress bar upload fileupload progress bar in total filehow to add progress bar to file uploadupload progress barshow to show progress bar while uploading file in jqueryfile upload ui html with progress bar phphow to add progress bar for uploading filehow to show uploading progress barfile upload progress bar 25upload progress bar javascriptupload progress barimage upload progressin browserfile upload progress bar javascriptget percent upload form ajaxsubmitprogress bar until upload fileupload button with progress barupload progress for fileupload file with progress barjs file upload progressfile upload progressbar event listenerprogress bar html file uploadupload file progress bar jqueryafter upload file my progress bar takes timeupload file with real time progress bar file upload progress bar percentagejquery file upload progressprogress bar in uploadprogress bar for file uploadupload image show progressbarfileupload progress on upload progress barfile upload with progress bar