public bool TransferResource(ResourceTransfer resource) { //encrypt login and password string loginName = ""; string pass = ""; getloginAndPass(UserId, ref loginName, ref pass); string _url = getWSUrl(this.Url); RepositoryWebservice repo = new RepositoryWebservice(_url); repo.Credentials = new System.Net.NetworkCredential(loginName, pass); var res = resource.Resource; if (!Core.Settings.disableZip) res.ResourceContents = Compression.Compress(res.ResourceContents); if (!Core.Settings.disableBase64Encoding) { res.ResourceAsBase64 = Convert.ToBase64String(res.ResourceContents); res.ResourceContents = new byte[0]; } bool transfered = false; try { transfered = repo.TransferResource(this.SessionKey, resource.ItemID, resource.ItemType, res, resource.OverWrite, loginName, pass); if (transfered) RevisionLog.Instance.AddItemEntry(resource.ItemID, this.GetType(), "resources", resource.Resource.ExtractToPath + " transfered", LogItemEntryType.Success); else RevisionLog.Instance.AddItemEntry(resource.ItemID, this.GetType(), "resources", resource.Resource.ExtractToPath + " not transfered", LogItemEntryType.Error); } catch (Exception ex) { RevisionLog.Instance.AddItemEntry(resource.ItemID, this.GetType(), "resources", ex.ToString(), LogItemEntryType.Error); } repo.Dispose(); return transfered; }