title: Uploading Files to Web Hosted Server not working but works on local machine
body: <p>Currently, the user uploads a barcode file to the server and then the server decodes this and send a response back to the client. This all works fine when I run the web application on my local machine, but when I publish it to my web hosting (Gear Host), it doesn't work.</p>
  
  <p>Here is my code:</p>
  
  <p>Client Side:</p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt;
  
      &lt;label class="btn btn-default btn-file btn-lg"&gt;
          Start Audit
          &lt;input type="file" accept="image/*;capture=camera" name="file" id="file" onchange="this.form.submit();" style="display: none;"&gt;
      &lt;/label&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Server side:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(HttpPostedFileBase file)
      {
          if (file.ContentLength &gt; 0)
          {
              var fileName = Path.GetFileName(file.FileName);
              var path = Path.Combine(Server.MapPath("~/App_Data/Temp"), fileName);
              file.SaveAs(path);
  
              // create a barcode reader instance
              IBarcodeReader reader = new BarcodeReader();
              // load a bitmap
              Bitmap bitmap = new Bitmap(path);
  
              Bitmap resized = new Bitmap(bitmap, new Size(400, 400));
  
              // detect and decode the barcode inside the bitmap
              var result = reader.Decode(resized);
  
              // Delete file once we have finished with it
              /*if (System.IO.File.Exists(path))
              {
                  System.IO.File.Delete(path);
              }*/
  
              // do something with the result
              if (result != null)
              {
                  return RedirectToAction("../Room/" + result.Text);
                  //txtDecoderType.Text = result.BarcodeFormat.ToString();
                  //txtDecoderContent.Text = result.Text;
  
              }
  
              // Decode error
              else
              {
                  return RedirectToAction("Index");
              }
          }
  
          // File error
          else
          {
              return RedirectToAction("Index");
          }      
      }
  </code></pre>
  
  <p>Any help is appreciated, is this something I need to contact my hosting about?</p>