This project has moved and is read-only. For the latest updates, please go here.

BeginRequest never comes back

Feb 17, 2011 at 8:45 AM


Since yesterday, I have an issue in my code.

I do this

request.AddFile("userfile", "test", stream);
this._client.BeginRequest(request, new RestCallback(UploadPictureCompleted));

But, UploadPictureCompleted is never called. When I do this with addParameter or remove addFile it works.

I worked yesterday and I don't remember what I've changed...

Feb 17, 2011 at 6:06 PM


Here is the problem:

  • If y try to read the stream before sending it

var bitmapImage = new BitmapImage();
request.AddFile("userfile", "test", e.ChosenPhoto);
this._client.BeginRequest(request, new RestCallback(UploadPictureCompleted));

This doesn't work. I never enter in UploadPictureCompleted
  • If I try to read it after (in the UploadPictureCompleted where I can enter this time, it says to me : "Cannot access a closed file."

Any idea how I can display my picture? (before calling BeginRequest if possible).





Feb 19, 2011 at 12:50 PM

I'm not sure what the context for this is - what type of picture are you trying to show and where are you getting it from?