public ActionResult RemovePage(string filename) { // there is nothing to remove because we already imported the file UploadRemoveResponse resp = new UploadRemoveResponse(); return(new YJsonResult { Data = resp }); }
public async Task <ActionResult> RemoveImage(string __filename, string __internalName) { FileUpload upload = new FileUpload(); await upload.RemoveTempFileAsync(__internalName); UploadRemoveResponse resp = new UploadRemoveResponse(); return(new YJsonResult { Data = resp }); }
public async Task <ActionResult> RemoveSelectedImage(string name, string folderGuid, string subFolder, string fileType) { string namePlain = name.RemoveStartingAt(ImageSupport.ImageSeparator); FileUpload upload = new FileUpload(); string storagePath = ImageSelectionInfo.StoragePath(new Guid(folderGuid), subFolder, fileType); await upload.RemoveFileAsync(namePlain, storagePath); HtmlBuilder hb = new HtmlBuilder(); foreach (var f in await ImageSelectionInfo.ReadFilesAsync(new Guid(folderGuid), subFolder, fileType)) { string fPlain = f.RemoveStartingAt(ImageSupport.ImageSeparator); hb.Append(string.Format("<option title='{0}' value='{1}'>{2}</option>", Utility.HtmlAttributeEncode(fPlain), Utility.HtmlAttributeEncode(f), Utility.HtmlEncode(fPlain))); } UploadRemoveResponse response = new UploadRemoveResponse { Result = $@"$YetaWF.confirm('{Utility.JserEncode(this.__ResStr("removeImageOK", "Image \"{0}\" successfully removed", namePlain))}');", List = hb.ToString(), }; return(new YJsonResult { Data = response }); }