I have one application that is using NeatUpload as a web page and it's working perfectly. We have another application that runs as a web service and takes in files as DIME attachments. I would like to upgrade it to use NeatUpload so that it can handle larger files.
The web service allows multiple DIME attachments to come in using code similar to this:
Dim iByte as Integer Dim fs As FileStream = File.Create(tempSaveFileDirectory & "\" & filename)
Do While iByte <> -1 RequestSoapContext.Current.Attachments(i).Stream.ReadByte() If iByte = -1 Then Exit Do End If fs.WriteByte(iByte) Loop
I have added the UploadHttpModule lines in the web.config.
The file it fails on is about 12mb. Which it seems like would be within the limit. I am testing this locally with both applications on the same computer. Does anyone have an idea of what I could be doing wrong?
There was an exception running the extensions specified in the config file. --> Maximum request length exceeded.
Now, does anyone have an idea of what could be causing that? It seems to be something to do with the test page site sending a message to the web service that is too large, but I don't know where to go to fix it, or what limit needs to be increased.
The error you are currently getting is probably because the file being sent to the web service is larger than the value specified in the NeatUpload.MaxNormalRequestLength setting of the web service's Web.config file. The request length settings in ASP.NET and NeatUpload refer to the size of incoming requests not outgoing requests.
Having said that, NeatUpload isn't going to help you with the web service because it only streams files uploaded via an InputFile control on a web form. You could try to hack the code to make it work for DIME attachments but my sense is that it would not be a small task. Alternatively, you could use .NET 2.0 (which automatically streams large requests to disk) for the web service since it doesn't make sense to have a progress bar there. So in the web service Web.config I'd remove the NeatUpload stuff and just increase maxRequestLength in the httpRuntime element.
NeatUpload can help with the upload from the browser to the test page assuming you are using an InputFile there. If the test page or something like it is going to visible to your customers and you want the progress bar to indicate the percent actually sent to web service, you might be able to use the latest development snapshot and implement an UploadStorageProvider which streams the upload directly to the web service.