Uploading photo on wp7

Topics: Developer Forum
Feb 4, 2012 at 3:08 AM

Hi Sam,

Whenever I try to upload a photo I get the following ArgumentException. " Value does not fall within the expected range." It doesn't matter how big or small the image is, it always throws this exception.

The image I want to upload is from a PhotoCamera. here is the delegate inside which I call the FlickrNet's uploadphotoasync method.

 void cam_CaptureAvailable(object sender, ContentReadyEventArgs e)

        _flickr.UploadPictureAsync(e.ImageStream, "Trial", "Trial", "Trial", "Trial", true, true, true, ContentType.Photo, SafetyLevel.None, HiddenFromSearch.None, (callback) => { });


I have already authenticated the _flickr.

Here is the stack trace if it might help.

System.ArgumentException was unhandled
  Message=Value does not fall within the expected range.
       at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at MS.Internal.InternalWebRequestStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at FlickrNet.Flickr.<>c__DisplayClass4e.<UploadDataAsync>b__4c(IAsyncResult r)
       at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass6.<InvokeGetRequestStreamCallback>b__4(Object state2)
       at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadPool.WorkItem.doWork(Object o)
       at System.Threading.Timer.ring()



Feb 6, 2012 at 9:22 AM

Sorry, yes, there was a bug introduced recently.

I've now fixed this and will be releasing a new version of the DLL very soon.


Feb 6, 2012 at 6:58 PM

Thanks Sam,