Hi,
I have a Web Service that contains a WebMethod to upload a file. The method contains a byte array parameter which the file is passed in as, and the file name. It then uses a FileStream to write the file to disk:
[WebMethod]
public string UploadContent(byte[] objFile, string ContentName)
{
// Open FileStream
FileStream fsFile = new FileStream(FolderName + ContentFileName, FileMode.Create);
long FileLength = objFile.Length;
fsFile.Write(objFile, 0, (int)FileLength);
fsFile.Flush();
fsFile.Close();
}
The Web Service consumer of this is a Web Site. On the .aspx page there is a FileUpload control, called ItemUpload. The code to upload the file is:
byte[] FileInBytes = ItemUpload.FileBytes;
myWebService.myWebService oWS = new myWebService.myWebService();
string sReturn = oWS.UploadContent(FileInBytes, ContentName);
This is working fine for small files (<4Mb), but when I try to upload a larger file I'm getting this message:
"The request failed with HTTP status 404: Not Found."
I have modified the Web.Config of the Web Service and also the consuming web site to allow for files of up to 100Mb:
<httpRuntime maxRequestLength="102400"/>
Is there something else I am missing?