public void Upload(Connection connection) { if (null == connection) { throw new ArgumentNullException("connection"); } using (Stream data_stream = File.OpenRead(Uri.LocalPath)) { connection.UploadFile(Name, data_stream, MimeType, null); } }
public void Upload(Picture picture) { if (null == picture) { throw new ArgumentNullException("picture"); } string tags = GetTagsAsString(picture); string [,] arguments = { { "security", preferences.Privacy }, { "tags", tags }, }; using (Stream data_stream = File.OpenRead(picture.Uri.LocalPath)) { Debug.WriteLine("NEW UPLOAD: " + picture.Uri.LocalPath); connection.UploadFile(picture.Name, data_stream, picture.MimeType, arguments); } }
public void Upload (Connection connection) { if (null == connection) { throw new ArgumentNullException ("connection"); } using (Stream data_stream = File.OpenRead (Uri.LocalPath)) { connection.UploadFile (Name, data_stream, MimeType, null); } }