title: Web API : Read the image send from the app
body: <p>I need to read the file been send from the Ios app to the Azure web api.</p>
  
  <p>I need to upload that to the blob and keep the Uri.</p>
  
  <p>Can anybody suggest me the code to accept the file been send.</p>
  
  <pre><code> /// &lt;summary&gt;
      ///This is to upload the image file for the user profile.
      /// &lt;/summary&gt;
      ///&lt;param name="userRegId"&gt; &lt;/param&gt;
      ///&lt;returns&gt;&lt;/returns&gt;
      [HttpPost]
      public Response ImageUpload(int  userRegId)
      {
          try
          {
              var response = new Response();
              if (!Request.Content.IsMimeMultipartContent())
              {
                  response.status = CommonHandler.GetInvalidStatus();
              }
              else
              {
  
                  //here i want to read the file and upload it to blob.
  
  
                  string fileName =Request.Files[0].FileName;//unable to do this. Here i want to know ho to read the file
                  string uniqueBlobName = string.Format("{0}/{1}", constants.pdf, fileName);
                  CloudBlobClient blobStorage = cloudClasses.CreateOrGetReferenceOfBlobStorage(constants.pdf);
                  CloudBlockBlob blob = cloudClasses.ClouBblockBlobPropertySetting(blobStorage, uniqueBlobName, ".pdf");
                  blob.UploadFromStream(Request.Files[0].InputStream);//unable to do this.  Here i want to know ho to read the file
                  response.status = CommonHandler.GetSuccessStatus();
              }
              return response;
          }
          catch (Exception ex)
          {
              _logger.LogError(Log4NetLogger.Category.Exception, "Error in : APIController.ImageUpload :&gt;&gt; Exception message: " + ex.Message);
              return new Response { status = CommonHandler.GetFailedStatus(ex.Message) };
  
          }
      }
  </code></pre>