title: image uploading from android application to server using c# web service
body: <p>I want to upload image to IIS server using c# web service. I have written the web method for this as follows:</p>
  
  <pre><code>[WebMethod] 
  public string UploadFile(byte[] f, string fileName)
  {
      try
      {
         MemoryStream ms = new MemoryStream(f);
  
         FileStream fs = new FileStream(System.Web.Hosting.HostingEnvironment.MapPath
         ("~/TransientStorage/") +fileName, FileMode.Create); 
  
         ms.WriteTo(fs); 
  
         ms.Close();
         fs.Close();
         fs.Dispose(); 
  
         return "OK";
      }
      catch (Exception ex)
      {
          // return the error message if the operation fails
          return ex.Message.ToString();
      }
  }
  </code></pre>
  
  <p>Here the web method is taking argument as byte[] .I have convert the sdcard image to byte[] but when i am passing it as an URL paramete it is not working .I have also tried by converting the byte[] array to base64 strig still it is not working.</p>
  
  <p>Can any one tell me how to upload image to IIS server using c# web service.</p>