/// <summary> /// Upload the sharing-info file to the server /// </summary> /// <param pathFullName="newSharingInfo">From.To.Filename.URL.ReKey</param> /// <returns></returns> public Boolean Upload(SharingInfo newSharingInfo) { String sharingInfoFileDir = String.Format("/{0}", newSharingInfo.ID_TO); String sharingInfoFileName = String.Format("{0}.txt", newSharingInfo.Reference); String sharingInfoFilePath = String.Format("{0}/{1}", sharingInfoFileDir, sharingInfoFileName); try { //this.Client.Delete( sharingInfoFilePath ); Client.Delete(sharingInfoFilePath); } catch (System.Exception) { } try { MemoryStream ms = new MemoryStream(); BinaryFormatter bfer = new BinaryFormatter(); bfer.Serialize(ms, newSharingInfo); Client.UploadFileAsync(sharingInfoFileDir, sharingInfoFileName, ms.ToArray(), (response) => {}, (error) => { //SecuruStikException.ThrowSecuruStik( // SecuruStikExceptionType.DropBoxControl_Upload , "UpLoadError" , error ); }); return(true); } catch (System.Exception) { return(false); } }
public ActionResult Remove(string[] fileNames) { // The parameter of the Remove action must be called "fileNames" foreach (var fullName in fileNames) { var _client = new DropNetClient(accessKey, secretAccessKey, userTokenKey, userSecretKey); try { _client.Delete(path + fullName); } catch (DropNet.Exceptions.DropboxException) { } return Content(""); } // Return an empty string to signify success return Content(""); }
public ActionResult DeleteFile(string path) { var _client = new DropNetClient(accessKey, secretAccessKey, userTokenKey, userSecretKey); _client.Delete(path); return Content(""); }