upload photo progress

Topics: User Forum
Jan 11, 2007 at 9:44 AM
hi all,

i want to know the upload progress when load photo to flickr. i hope can get regular reports on how many bytes have been uploaded. which function can help me to do it. thanks for your kindly reply.

Jan 11, 2007 at 1:53 PM
How about the UploadProgressEvent?
Jan 11, 2007 at 3:01 PM
thanks for your kindly reply.
due to i am a beginner in Flickr.
could you please explian more detail.
if possible, can you show me how to do it.
thank you very much.
Jan 12, 2007 at 2:59 PM
In your upload button (or wherever) do this:

Flickr f = new Flickr(ApiKey, SharedSecret, AuthToken);
f.OnUploadProgress += new Flickr.UploadProgressHandler(Flickr_OnUploadProgress);
System.IO.FileInfo fi = new System.IO.FileInfo(Filename);
fileSize = fi.Length;
string p = f.UploadPicture(UploadFilenameTextBox.Text, "Test Upload", "Test Upload Description", "testupload", false, false, false);

Then the progress method would be something like this:

private void Flickr_OnUploadProgress(object sender, UploadProgressEventArgs e)
	Console.WriteLine("Upload progress: {0} ({1})", e.Bytes, (e.Bytes/fileSize).ToString("0.0%"));