BeginRequest never comes back

Feb 17, 2011 at 7:45 AM

Hy,

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 5:06 PM

Ok.

Here is the problem:

  • If y try to read the stream before sending it

var bitmapImage = new BitmapImage();
bitmapImage.SetSource(e.ChosenPhoto);
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).

 

 

 

 

Coordinator
Feb 19, 2011 at 11:50 AM

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?