Re: WebClient Timeout Exception

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michael Fields (MichaelFields_at_discussions.microsoft.com)
Date: 03/04/05


Date: Thu, 3 Mar 2005 16:39:03 -0800

The problem is not trying to send email. Here is the scenerio. A C# windows
app needs to upload a file to a webserver. Its 4 MB zip file.

"Wayne" wrote:

> I didn't know about the web.mail namespace back when I needed to send email,
> the link below is a very simple example of how to send email with C#. I have
> been using this for sometime with out issues. If all else fails you could
> try it out.
>
> http://www.codeproject.com/csharp/sendmailcsharp.asp
>
>
>
> --
> Thanks
> Wayne Sepega
> Jacksonville, Fl
>
>
> "When a man sits with a pretty girl for an hour, it seems like a minute. But
> let him sit on a hot stove for a minute and it's longer than any hour.
> That's relativity." - Albert Einstein
>
> "Michael Fields" <Michael Fields@discussions.microsoft.com> wrote in message
> news:2985BBB8-ED15-43EF-8567-D6DEF48FF5A3@microsoft.com...
> > I have a problem with the WebClient and uploading a file to a web server.
> The
> > stream object returned from the WebClient.OpenWrite menthod throws a
> timeout
> > exception when using this method on computers w/ low bandwith ( < = 256
> kbs).
> > The exception occurs when I call the Stream.Close method. Here is the
> code:
> >
> > WebClient client = new WebClient();
> > Stream postStream = client.OpenWrite(uri,"PUT");
> > postStream.Write(buffer, 0, buffer.Length);
> > postStream.Flush();
> > postStream.Close();
> >
> > Buffer length is around 4 MB. The code shown is from a Windows App that
> > consumes a web service. I have tried several approaches, but haven't found
> a
> > working solution, such as..
> >
> > Writing a 2k chunk and calling flush until the entire buffer is read
> > Writing a webservice method that takes an array of bytes
> >
> > Any suggestions would be extremely helpful
> > Thanks in advance
> >
>
>
>



Relevant Pages

  • [Full-Disclosure] ws_ftp.log
    ... upload files to their website, ... now people might use extensive google search to find ... that those files will still be in there in web server. ... webserver logs) and quickly finds out some vital ...
    (Full-Disclosure)
  • Re: Uploading to a web server
    ... How would the user authenticate against the web server or is that not ... > Do you have the necessary rights to upload files to the webserver? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: nobody using sudo -- scary!
    ... don't run your webserver as "nobody". ... If this web server is tightly controlled and only used for controlling ... it permission to run that script. ...
    (comp.lang.perl.misc)
  • RE: website inside or outside the domain?
    ... it is better not to have domain authentication traffic ... publicly accessible web server in a DMZ, with a DC also in the DMZ ... > webserver is ... network) its not the best model to use. ...
    (Focus-Microsoft)
  • Re: design issue - embedded webserver application
    ... A webserver should run on the SBC so that the system can be configured ... using some scripts embedded in html which the webserver then parses ... or suggestions about which technologies to use (cgi for interface? ... trivial learning curve if you don't know what a web server really does ...
    (comp.arch.embedded)