I am developing an HTML5/jQuery application in .NET 4.0. The application is used to upload the excel files using WCF Rest services (webHttp). The uploaded files saved in SQL Server drop zone and then SSIS process them.
For smaller files (few KB) there is no problem. however when I tried to upload files of size more than 2 MB (up to 5 MB) I am seeing jQuery Error that File can not be uploaded. Please try again.
The issue is the file is being saved successfully in SQL Drop Zone (I can see it there that means upload is successful) but since ETL process is taking lots of time (around 5-10 min) jQuery throws the error without waiting for the response from ETL (within 30 seconds).
This is my web.config look like:
<webHttpBinding>
<binding name="webBinding" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
transferMode="Streamed"
sendTimeout="00:05:00">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
<security mode="Transport"></security>
</webHttpBinding>
Is there a way I can resolve the issue so my application wait till it get the response from ETL (via WCF Service)?
Edit
have been troubleshooting the issue and looks like Error is coming exactly after 30 seconds, no matter what settings I apply in web.config file as above.
So is there a way to increase this timeout to avoid the error?
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/DemoService.svc/FileUpload", timeout: 0,
data: obj,
processData: false,
contentType: false,
success: function (response) {
//
},
error: function (Result) {
$("#error").html("Unable to upload. Please try again!!!").removeClass("hide");
}
});