title: SWFUpload Authentication
body: <p>I am using SWFUpload to do file uploading in a ASP.NET MVC 1.0 website. It is working fine, but I am not able to authenticate the upload method. The HttpContext.User.Identity.Name returns an empty string. I am assuming this is because the Flash movie is making the post. I am also using the wrapper provided here: <a href="http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/" rel="nofollow noreferrer">http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/</a>.</p>
  
  <p>The controller action below gets fired, but as mentiond above the user object is not passed.</p>
  
  <p>Any help is appreciated!</p>
  
  <p><strong>View</strong></p>
  
  <p><em>HTML</em></p>
  
  <pre><code>            &lt;form enctype="multipart/form-data" method="post" action="/Media/Upload/Photo"&gt;
                  &lt;input type="file" id="userPhoto_Photo" name="userPhoto_Photo" /&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p><em>Javascript</em></p>
  
  <pre><code>    $(function() {
          $("#userPhoto").makeAsyncUploader({
              upload_url: '/Media/Upload',
              flash_url: '&lt;%= Url.Content("~/Content/Flash/swfUpload-2.2.0.1.swf") %&gt;',
              file_size_limit: '1 MB',
              file_types: '*.jpg; *.png; *.gif',
  
              button_action: SWFUpload.BUTTON_ACTION.SELECT_FILE, 
              button_width: 210,
              button_height: 35, 
              button_image_url: '&lt;%= Url.Content("~/Content/Images/UploadPhoto.png") %&gt;',
              button_text: '',
  button_cursor: SWFUpload.CURSOR.HAND,
  button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT
  
          });
      });   
  </code></pre>
  
  <p><strong>Controller Action</strong></p>
  
  <pre><code>    [AcceptVerbs(HttpVerbs.Post)]
      public ActionResult Upload()
      {
          if (Request.Files.Count == 1)
          {
              //Upload work
          }
          return RedirectToAction("Index", "Profile");
      }
  </code></pre>