title: jQuery File Upload: how to change the upload url dynamically
body: <p>I'm trying to use the blueimp <a href="http://blueimp.github.com/jQuery-File-Upload/">jQuery File Upload</a> in my project. It suits my needs fairly well but I need to change the url files are uploaded to dynamically after the plugin is created and configured. I've done a good deal of investigation, but, unfortunately, found nothing useful. In general, I have a button to choose files and fileupload action covering the actual upload. The basic creation looks like this:</p>
  
  <pre><code> $('[upload-button]').fileupload(new FileUploadConfig()) 
  </code></pre>
  
  <p>And configuration itself:</p>
  
  <pre><code> function FileUploadConfig() {
  
       // is set to a unique value for each file upload
       this.url = 'temporary';
       this.fileInput = $('[upload-button]');
  
       //... some other code
   }
  </code></pre>
  
  <p>The thing I need to do is change the url in this config and then call <code>data.submit()</code>. I've found out, that this configuration is saved using <code>$.data()</code> and tried to solve the problem with such code</p>
  
  <pre><code>// get the current fileupload configuration
  var config = $.data($('[upload-button]').get(0), 'fileupload');
  
  // change the url configuration option
  config.options.url = file.link;
  
  //send a file
  data.submit();
  </code></pre>
  
  <p>However, this does not work the way I wanted. </p>
  
  <p>Any ideas on how to accomplish this?</p>