Topic: upload immediately

is there option to enable upload immediately after choosing the files?

Re: upload immediately

Nope, but it would be easy for you to add a event listener for it and start the upload of the queue.

Re: upload immediately

New UI Widget now has a special option for this, but it is not yet released. But everything it does, like Spocke said, is - binds itself to a FilesAdded event and starts uploading manually.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

Re: upload immediately

Here is my code for this :

  <div id="container">
    <a id="pickFiles" href="#"><img src="img/picture_add.png" /></a>
  </div>

<script type="text/javascript">

    var uploader = new plupload.Uploader({
      runtimes : 'flash',
      browse_button : 'pickfiles',
      container : 'container',
      max_file_size : '10mb',
      url : '<?php echo $me ?>',
      flash_swf_url : '/plupload/js/plupload.flash.swf',
      filters : [ {title : "Image files", extensions : "jpg,gif,png"} ],
      resize : {width : 320, height : 240, quality : 90}
    });

    uploader.bind('FilesAdded', function(up, files) {
      up.start();
    });

    uploader.bind('FileUploaded', function(up, file) {
      alert("File uploaded");
    });

    uploader.init();
</script>

Should work OK in theory, but fails in practice : it only starts uploading after a second file has been added to the queue.

Maybe a developer can be of further help ?

Re: upload immediately

You must call the init function between creating your instance of plupload and binding your FilesAdded callback.

I also have a call to up.refresh before calling start in my FilesAdded callback as well.  I'm not sure if this is still needed for any of the runtimes but at one time it was needed (for flash maybe??).  Anyway it doesn't hurt - you can try it with or without and make up your own mind.

See below for my suggested changes.

Mike

  <div id="container">
    <a id="pickFiles" href="#"><img src="img/picture_add.png" /></a>
  </div>

<script type="text/javascript">

    var uploader = new plupload.Uploader({
      runtimes : 'flash',
      browse_button : 'pickfiles',
      container : 'container',
      max_file_size : '10mb',
      url : '<?php echo $me ?>',
      flash_swf_url : '/plupload/js/plupload.flash.swf',
      filters : [ {title : "Image files", extensions : "jpg,gif,png"} ],
      resize : {width : 320, height : 240, quality : 90}
    });

    uploader.init;   //  ** Init the uploader.

    uploader.bind('FilesAdded', function(up, files) {
      up.refresh();   //  ** this seems to show up in lots of examples as well.
      up.start();
    });

    uploader.bind('FileUploaded', function(up, file) {
      alert("File uploaded");
    });

    uploader.init();
</script>

Re: upload immediately

Thanks for the code made a huge difference in the upload time.

[url=http://www.amybrett.com]MLM Opportunity[/url]
[url=http://www.mbrettpainitng.com]Residential Painting Contractor[/url]
[url=http://www.amybrett.com]MLM Business[/url]