title: Pass file upload control as a parameter to a method
body: <p>I want to write a general file upload function in C#. My website has more than 20 columns divided into tabs consisting of nearly 8 - 10 file upload controls. 
   I would like to write a general method into which i could pass the fileupload control, posted file &amp; location to be saved. How do i pass the fileupload control to a method ?</p>
  
  <pre><code>public string uploadMethod(HttpPostedFile file, &lt;fileUpload control&gt;, string saveLocation)
  {
    //saving code
  }
  
  protected void btnSubmit_Click(object sender, EventArgs e)
  {
      uploadMethod(FileUpload1.PostedFile, &lt;fileUpload control&gt;, saveFolder)
  }
  </code></pre>
  
  <p>I know how to save the path but have no clue how to pass a fileupload control as a parameter to a method. Would be grateful for your help :)</p>