Home jquery Plupload file download plugin

Plupload file download plugin

Author

Date

Category

Hello!

For multiple download files, I’m trying to use the plupload . The plugin works well, but now after selecting the files, I need to set the parameters for the script – the file recipient. I tried to do this by adding the following to the code:

uploader.bind ('FilesAdded', Function (Up, Files) {
  alert ("hello");
  uploader.settings.
    .multipart_params.
    .foto_spisok_title = $ ("# Foto_Spisok_title")
    .val ();
  uploader.settings.
    .multipart_params.
    .foto_spisok_date = $ ("# Foto_Spisok_Date")
    .val ();
  uploader.settings.
    .multipart_params.
    .foto_spisok_id = $ ("# Foto_Spisok_ID")
    .val ();
});

But nothing worked, even an alert. All code is obtained:

& lt; script type = "text / javascript" & gt;
  // Convert Divs To Queue Widgets WHEN THE DOM IS READY
  $ (Function () {
    $ ("# Uploader"). PluploadQueue ({
      // General Settings
      Runtimes: 'Gears, Flash, Silverlight, Browserplus, HTML5',
      URL: 'upload.php',
      max_file_size: '100mb',
      chunk_size: '1MB',
      // Unique_Names: True,
      // resize images on clientside if we can
      Resize: {
        Width: 320,
        Height: 240,
        Quality: 90.
      },
      Multipart: True,
      Multipart_params: {
        Param1: '5',
        Param2: '3'
      },
      // Specify What Files to Browse for
      Filters: [{
        Title: "Image Files",
        Extensions: "JPG, GIF, PNG"
      }, {
        Title: "Zip Files",
        Extensions: "zip"
      }],
      // Flash Settings
      flash_swf_url: '/plupload/js/plupload.flash.swf',
      // Silverlight Settings
      Silverlight_xap_URL: '/Plupload/js/plupload.silverlight.xap'
    });
    // Client Side Form Validation
    $ ('Form'). submit (Function (E) {
      var uploader = $ ('# Uploader'). PluploadQueue ();
      Uploader.Bind ('FilesAdded', Function (Up, Files) {
        alert ("hello");
        uploader.settings.
          .multipart_params.
          .foto_spisok_title = $ ("# Foto_Spisok_title")
          .val ();
        uploader.settings.
          .multipart_params.
          .foto_spisok_date = $ ("# Foto_Spisok_Date")
          .val ();
        uploader.settings.
          .multipart_params.
          .foto_spisok_id = $ ("# Foto_Spisok_ID")
          .val ();
      });
      // Files in Queue Upload Them First
      if (uploader.files.
        .length & gt; 0) {
        // WHEN ALL FILES ARE UPLOADED SUBMIT FORM
        Uploader.Bind ('StateChanged', Function () {
          if (uploader.files.
            .length === (Uploader.total
            .uploaded + uploader.
            .total
            .failed)) {
            alert ("hello");
            $ ('Form') [0] .submit ();
          }
        });
        uploader.start ();
      } else {
        Alert ('You Must Queue at Least One File.');
      }
      RETURN FALSE;
    });
  });
& lt; / script & gt;

Answer 1, Authority 100%

Yes Learn how to use the console, in the end !!! Eg

$ ('# user'). Test ();

Clear things that in no JavaScript nor in jQuery there is no such function (omit while regular), what does the browser do? He takes it to the console:

Link to the same mode in full: Full Image

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions