분류
jQuery
여러 파일 선택, 드래그 앤 드롭 지원, 진행률 표시 줄, 유효성 검사 및 미리보기 이미지, 오디오 및 비디오 jQuery에 …
본문
https://github.com/blueimp/jQuery-File-Upload
https://blueimp.github.io/jQuery-File-Upload/
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>jQuery File Upload Example</title> </head> <body> <input id="fileupload" type="file" name="files[]" data-url="server/php/" multiple> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="js/vendor/jquery.ui.widget.js"></script> <script src="js/jquery.iframe-transport.js"></script> <script src="js/jquery.fileupload.js"></script> <script> $(function () { $('#fileupload').fileupload({ dataType: 'json', done: function (e, data) { $.each(data.result.files, function (index, file) { $('<p/>').text(file.name).appendTo(document.body); }); } }); }); </script> </body> </html>
$('#fileupload').fileupload({ /* ... */ progressall: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .bar').css( 'width', progress + '%' ); } });
- 이전글Bootstrap Sidebar 18.10.21
- 다음글Bootstrap Image Gallery 18.10.21