Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
552 views
in Technique[技术] by (71.8m points)

javascript - Uploading Whole Folder with PLUPLOAD

Is it Possible to Upload Whole folder using PLUPLOAD.

I have created code to upload files using PLUPLOAD and it's Work great but i want to upload whole folder using the same.

Is it Possible If yes then how??

<!DOCTYYPE html>
<html>
  <head>
    <title>Chunking Upload Demo</title>
    <script src="plupload/js/plupload.full.min.js"></script>
    <script>
      window.addEventListener("load", function () {
        var path = "plupload/js/`";

        var uploader = new plupload.Uploader({
          browse_button: 'pick-book',
          container: document.getElementById('upload-area'),
          url: 'chunk1.php',
          chunk_size: '8mb',
          max_retries: 2,
          init: {
            PostInit: function () {
              document.getElementById('filelist').innerHTML = '';
            },
            FilesAdded: function (up, files) {
              plupload.each(files, function (file) {
                document.getElementById('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
              });
              uploader.start();
            },
            UploadProgress: function (up, file) {
              document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
            },
            Error: function (up, err) {
              // DO YOUR ERROR HANDLING!
              console.log(err);
            }
          }
        });
        uploader.init();
      });
    </script>
  </head>
  <body>
    <div id="upload-area">
      <input type="file" id="pick-book" placeholder="" webkitdirectory mozdirectory />
    </div>
    <div id="filelist">Your browser doesn't have Flash, Silverlight or HTML5 support.</div>
  </body>
</html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...