title: How does SWFUpload work?
body: <p>My code below works, except for the upload part. So far I am able to load the script without any problems, and the file dialogue opens when the a user clicks the upload button. </p>
  
  <p>However, what I am trying to do is to assign the file to a form which contains other text input and text-area elements. </p>
  
  <p>Basically I am trying to do this:</p>
  
  <ol>
  <li>User fills the form up with values (i.e. filling up text input, text-area fields)</li>
  <li>User selects a file using SWFUpload </li>
  <li>User submits the form</li>
  </ol>
  
  <p>Is it possible to hook the file to a file input element on the form so when the form is submitted manually, all the values are sent on one go?</p>
  
  <p>As far as I know, SWFUpload is used to submit the file automatically on the background on its own... Can this be done manually instead and on one form?</p>
  
  <pre><code>     $('.swfupload-control').swfupload({
  
          // File Upload Settings
          file_size_limit : "102400", // 100MB
          file_types : "*.*",
          file_types_description : "All Files",
          file_upload_limit : "10",
          file_queue_limit : "0",
  
          // Button Settings
          button_image_url : "/images/upload_song.gif", // Relative to the SWF file
          button_placeholder_id : "spanButtonPlaceholder",
          button_width: 186,
          button_height: 32,
  
          // Flash Settings
          flash_url : "/javascripts/swfupload/swfupload.swf"
  
      });
  
  
      $('.swfupload-control')
          .bind('swfuploadLoaded', function(event){
              $('#log').append('&lt;li&gt;Loaded&lt;/li&gt;');
          })
          .bind('fileQueued', function(event, file){
              $('#log').append('&lt;li&gt;File queued - '+file.name+'&lt;/li&gt;');
  
            //$('#song_attachment').val(file);
  
            $('#update-media').parents('li').find('p').remove();
            $('#update-media').parents('li').append('&lt;p&gt;'+(file.name.length &gt;= 45 ? file.name.substr(0, 45) + '...' : file.name)+'&lt;/p&gt;');
              // start the upload since it's queued
              //$(this).swfupload('startUpload');
          })
          .bind('fileQueueError', function(event, file, errorCode, message){
              $('#log').append('&lt;li&gt;File queue error - '+message+'&lt;/li&gt;');
          })
          .bind('fileDialogStart', function(event){
              $('#log').append('&lt;li&gt;File dialog start&lt;/li&gt;');
          })
          .bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){
              $('#log').append('&lt;li&gt;File dialog complete&lt;/li&gt;');
          })
          .bind('uploadStart', function(event, file){
              $('#log').append('&lt;li&gt;Upload start - '+file.name+'&lt;/li&gt;');
          })
          .bind('uploadProgress', function(event, file, bytesLoaded){
              $('#log').append('&lt;li&gt;Upload progress - '+bytesLoaded+'&lt;/li&gt;');
          })
          .bind('uploadSuccess', function(event, file, serverData){
              $('#log').append('&lt;li&gt;Upload success - '+file.name+'&lt;/li&gt;');
          })
          .bind('uploadComplete', function(event, file){
              $('#log').append('&lt;li&gt;Upload complete - '+file.name+'&lt;/li&gt;');
              // upload has completed, lets try the next one in the queue
              $(this).swfupload('startUpload');
          })
          .bind('uploadError', function(event, file, errorCode, message){
              $('#log').append('&lt;li&gt;Upload error - '+message+'&lt;/li&gt;');
          });
  </code></pre>