Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6699345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:41:05+00:00 2026-05-26T06:41:05+00:00

I have an upload form with plupload and a checkbox with boolean value after

  • 0

I have an upload form with plupload and a checkbox with boolean value after the plupload div.

I want to change the value of the url in plupload if the checkbox is checked.

Here is my code

<div id="uploader">
    <p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
</div>
<input id="compressFiles" type="checkbox" name="compressFiles" style="margin:10px 0 0 10px;" value="compress" checked="checked" /> 

$(function() {

$("#compressFiles").change(function(){
    if( $("#compressFiles").is(':checked') ){
            compress = 'compress';
       }
       else{
        compress = 'no';
       }
})

$("#uploader").plupload({

    runtimes : 'gears,flash,html5,html4,browserplus,silverlight',
    url: 'uploadHandler.php?compressFiles=' + compress,
    max_file_size : '1000mb',
    max_file_count: 20, // user can add no more then 20 files at a time
    unique_names : true,
    dragdrop : true,
    multiple_queues : true,

    // Addeb by LG - problem with FF
    filters: [
        {title: "All", extensions: "*"}
    ],

    // Rename files by clicking on their titles
    rename: true,

    // Sort files
    sortable: true,

    // Flash settings
    flash_swf_url : 'js/plupload.flash.swf',

    // Silverlight settings
    silverlight_xap_url : 'js/plupload.silverlight.xap',
    init : {
        FilesAdded: function(up) {
             if( $("#compressFiles").is(':checked') ){
                compress = "no"
             }
             else{
                 compress = "no"
             }
    }
    }

});

// Client side form validation
$('form').submit(function(e) {
    var uploader = $('#uploader').plupload('getUploader');

    // Validate number of uploaded files
    if (uploader.total.uploaded == 0) {
        // Files in queue upload them first
        if (uploader.files.length > 0) {
            // When all files are uploaded submit form
            uploader.bind('UploadProgress', function() {
                if (uploader.total.uploaded == uploader.files.length){ alert("coucou");
                    $('form').submit();}
            });

            uploader.start();
        } else
            alert('You must at least upload one file.');

        e.preventDefault();
    }
});

});

The value of url variable is defined first time page load with compress value. I tried 1000 thinhs but impossible to refresh the compress value in the url when checkbox change.

I hope my problem is clear, dont speak english very good.

Thanks for help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:41:05+00:00Added an answer on May 26, 2026 at 6:41 am

    Simply bind to the “BeforeUpload” event and you can change the uploader.settings to fit your needs.

    this.uploader.bind('BeforeUpload', function(uploader, file) {
      if($("#compressFiles").is(':checked')) {
        uploader.settings.url = "uploadHandler.php?compressFiles=compress";
      } else {
        uploader.settings.url = "uploadHandler.php?compressFiles=no";
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an upload form -- after the user submits the form, I'd like
I have a file upload form that is being posted back to a servlet
I have a form that excepts a file upload in ASP.NET. I need to
I upload file = Plupload . I checked variables $_FILES , $_POST , $this->data
I have File Upload form which users use to upload certain files on the
I have an upload form that uploads mp3s to my site. I have some
I have an upload form with a file to be uploaded. The issue I
I am building a file upload progress bar. Currently I have an upload form
I have designed a file upload form in PHP where it takes 3 pictures
I have an upload form for an image. When user selects a file, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.