Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <title>jQuery File Upload Example</title>
- <link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap.min.css">
- <!-- Generic page styles -->
- <!-- Bootstrap styles for responsive website layout, supporting different screen sizes -->
- <link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-responsive.min.css">
- <!-- Bootstrap CSS fixes for IE6 -->
- <!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]-->
- <!-- Bootstrap Image Gallery styles -->
- <link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/css/bootstrap-image-gallery.min.css">
- <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
- <link rel="stylesheet" href="css/jquery.fileupload-ui.css">
- </head>
- <?php
- if(($_FILES))
- var_dump($_FILES);
- else echo "Nothing";
- ?>
- <body>
- <form id="myform" method="post" enctype="multipart/form-data">
- <span class="btn btn-success btn-mini fileinput-button">
- <i class="icon-plus icon-white"></i>
- <span>Add files</span>
- <input id="fileupload" type="file" name="files[]" multiple>
- </span>
- <button type="submit" id="start_uploads">Start uploads</button>
- </form>
- <ul id="fileList">
- </ul>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/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 src="js/jquery.fileupload-ui.js"></script>
- <script>
- $(function () {
- $('#fileupload').fileupload({
- dataType: 'json',
- add: function (e, data) {
- $.each(data.files, function (index, file) {
- //alert('Added file: ' + file.name);
- $('<li/>').text(file.name).appendTo('#fileList');
- });
- return true;
- },
- });
- //$('#myform').bind('submit',function(){$('#fileupload').send()});
- //$('#start_uploads').click(function () {
- // $('.file_upload_start button').click();
- // return false;
- // });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement