title: Accessing the filepath using ajax call via JSON
body: <p>I've a file upload control in ASPX page that will only accept excel file. If the correct file is posted to the control, that file path will be send via a jQuery Ajax call to a web service. My web service will perform some calculation on the excel file and save that file locally. </p>
  
  <p>I run this project successfully in Visual Studio Development Sever. But when I deployed it on my production server, that file path is causing an error because it check that file locally in the production server. How can I overcome this issue?</p>
  
  <p>Here my jQuery ajax function :</p>
  
  <pre><code>    $.ajax({
              type: "POST",
              url: "ExcelUpload.asmx/FillObjets",
              data: JSON.stringify({ fileName: filename }),
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              beforeSend: function () {
                  $("#Status").html("&lt;br&gt;&lt;center&gt;&lt;img src=images/ajax-loader.gif/&gt;&lt;/center&gt;");
              },
              success: function (msg) {
              var output="";
               var re = eval('(' + msg.d + ')');
                    if (re.length &gt; 0) {
                        for (var i in re) {
                           var xl = re[i];
                           switch(parseInt(xl.status))
                           {
                              case 1: output=xl.message;break; 
                              case 2: output=xl.message;break;
                           }                          
                        }
                     $("#Status").html(output);
                  }
  
  
              },
              error: function (msg) {
                  alert(msg.d);
              }
  
          });           
  </code></pre>