title: How to delete uploaded files from specific user
body: <p>i'm using this <a href="http://www.dropzonejs.com/" rel="nofollow">http://www.dropzonejs.com/</a> in my create form
  When user click "Click here to add files" the files are stored in Files/TempFile
  but when user click submit on my create method i want to move all files from Files/TempFile to Files/TicketFile uploaded from the user, or if user click cancel to delete all files from Files/TempFile.
  The problem is what if there are several user that trying to upload files in the same time. If one of the user click cancel or submit how to know which files to move or delete.</p>
  
  <p><strong>CREATE VIEW</strong></p>
  
  <pre><code>@{
  ViewBag.Title = "Create";
  }
  
  @using (Html.BeginForm("Create", "Ticket", FormMethod.Post, new { enctype = "multipart/form-data" }))
  {
  @Html.AntiForgeryToken()
  @Html.ValidationSummary(true)
  &lt;fieldset&gt;
      &lt;legend&gt;Ticket&lt;/legend&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.idTicket)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.idTicket)
          @Html.ValidationMessageFor(model =&gt; model.idTicket)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.idProject, "Project")
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("idProject", String.Empty)
          @Html.ValidationMessageFor(model =&gt; model.idProject)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.tickettDescription)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.tickettDescription)
          @Html.ValidationMessageFor(model =&gt; model.tickettDescription)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.assignment, "User")
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("assignment")
          @Html.ValidationMessageFor(model =&gt; model.assignment)
      &lt;/div&gt;
      &lt;div class="jumbotron"&gt;
          &lt;div class="dropzone" id="dropzoneForm" style="width: 50px; background: none; border: none;"&gt;
              &lt;div class="fallback"&gt;
                  &lt;input type="file" id="fileInput" name="files" multiple="multiple" &gt;
                  &lt;input type="submit" id="submit" value="Upload" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
      &lt;div class="clear-fix"&gt;&lt;/div&gt;
      &lt;p&gt;
          &lt;input type="submit" value="Save" /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  }
  
  
  &lt;div&gt;
      @Html.ActionLink("Back to List", "Index")
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      //File Upload response from the server
      Dropzone.options.dropzoneForm = {
  
          init: function () {
              this.on("maxfilesexceeded", function (data) {
                  $.ajax({
  
                      url: '@Url.Action("SaveUploadedFile", "File", new { id=1})',
                  })
                  var res = eval('(' + data.xhr.responseText + ')');
              });
              this.on("addedfile", function (file) {
                  // Create the remove button
                  var removeButton = Dropzone.createElement("&lt;button&gt;Remove file&lt;/button&gt;");
  
                  // Capture the Dropzone instance as closure.
                  var _this = this;
  
                  // Listen to the click event
                  removeButton.addEventListener("click", function (e) {
  
                      // Make sure the button click doesn't submit the form:
                      e.preventDefault();
                      e.stopPropagation();
                      // Remove the file preview.
                      $.ajax({
                          type: "POST",
                          url: '@Url.Action("RemoveFile","File")',
                          contentType: "application/json; charset=utf-8",
                          data: "{name:" + JSON.stringify(file.name) + "}",
                          dataType: "json",
                          success: function () { _this.removeFile(file); }
  
                      });
                  })
  
                  // Add the button to the file preview element.
                  file.previewElement.appendChild(removeButton);
              });
          }
      };
  
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Save Method</strong></p>
  
  <pre><code> public ActionResult SaveUploadedFile()
      {
          bool isSavedSuccessfully = true;
  
          string fName = "";
          try
          {
              foreach (string fileName in Request.Files)
              {
                  HttpPostedFileBase file = Request.Files[fileName];
                  //Save file content goes here
                  fName = file.FileName;
                  if (file != null &amp;&amp; file.ContentLength &gt; 0)
                  {
                      string path = Server.MapPath("~/Files/TempFile/") + file.FileName;
                      file.SaveAs(path);
  
                  }
  
              }
  
          }
          catch (Exception ex)
          {
              isSavedSuccessfully = false;
          }
  
  
          if (isSavedSuccessfully)
          {
              return Json(new { Message = fName });
          }
          else
          {
              return Json(new { Message = "Error in saving file" });
          }
      }
  </code></pre>
  
  <p>i tried not to store to TempFile and when i click create to get all the files with</p>
  
  <pre><code> foreach (string fileName in Request.Files)
  </code></pre>
  
  <p>but Request.Files is always null.</p>