How do I modify the 'Caption' for an image?

Sep 25, 2012 at 4:48 PM

I tried the following code snipped:

Album a = __some album that I retrieved in earlier code__
var myUpload = a.CreateUploader();
Image img = myUpload.UploadImage(filename, md5sum);
img.Caption = filename;
img.ChangeSettings();

However it throws the following exception when executing the ChangeSettings method:

System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
   at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)
   at SmugMugModel.SmugMugBase.ToString() in SmugMugBase.cs:line 36
   at SmugMugModel.CommunicationHelper.ExecuteMethod[SMR](String method, SmugMugBase sessionState, String& su, Object[] args) in CommunicationHelper.cs:line 57
   at SmugMugModel.CommunicationHelper.ExecuteMethod[SMR](String method, SmugMugBase sessionState, Object[] args) in CommunicationHelper.cs:line 33
   at SmugMugModel.Image.ChangeSettings(String Extras) in Image.cs:line 380
Help!
Oct 16, 2012 at 4:26 PM

Never mind.  I see that I needed to add the following before I called UploadImage

myUpload.Caption = filename;