CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.faq_frequently_asked_questions Tags:
Item Type: NewsGroup Date Entered: 4/26/2007 8:22:39 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 49 Favorited: 0 Favorite
1 Items, 1 Pages 1 |< << Go >> >|
joker77
Asp.Net User
How to configure Web Service and Web Site for large files?4/26/2007 8:22:39 AM

0

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?

1 Items, 1 Pages 1 |< << Go >> >|


Free Download:




   
  Privacy | Contact Us
All Times Are GMT