private void button1_Click(object sender, EventArgs e) { using (TransferClient transfer = new TransferClient("BasicHttpBinding_ITransfer")) { using (FileStream stream = File.OpenRead("Commanigy.Transmit.Client.pdb")) { schemas.commanigy.com.UploadMeta md = new schemas.commanigy.com.UploadMeta(); md.Code = Guid.NewGuid().ToString("N"); transfer.Upload(md, stream); stream.Close(); } transfer.Close(); } }
/// <summary> /// Performs actual upload by streaming entire (zipped) file. /// </summary> /// <param name="token"></param> /// <param name="transferFileName"></param> /// <returns></returns> private string Upload(string token, string transferFileName) { using (TransferClient transfer = new TransferClient("BasicHttpBinding_ITransfer")) { using (FileStream stream = File.OpenRead(transferFileName)) { schemas.commanigy.com.UploadMeta meta = new schemas.commanigy.com.UploadMeta(); meta.Code = token; transfer.Upload(meta, stream); stream.Close(); } transfer.Close(); } return token; }