public virtual void SaveUpload() { long boardId = ctx.GetLong("boardId"); HttpFile postedFile = ctx.GetFileSingle(); Result result = Uploader.SaveFileOrImage(postedFile); if (result.HasErrors) { errors.Join(result); run(UploadForm); return; } AttachmentTemp uploadFile = savePostData(postedFile, result); // 返回数据给主页面 set("objFile", Json.ToString(uploadFile.GetJsonObject())); set("deleteLink", to(DeleteTempAttachment) + "?boardId=" + boardId); }
public virtual void SaveFlashUpload() { long boardId = ctx.GetLong("boardId"); HttpFile postedFile = ctx.GetFileSingle(); Result result = Uploader.SaveFileOrImage(postedFile); if (result.HasErrors) { logger.Error(result.ErrorsText); errors.Join(result); echoError(); return; } AttachmentTemp uploadFile = savePostData(postedFile, result); // 返回json给主页面 String photoJson = Json.ToString(uploadFile.GetJsonObject()); String json = "{\"deleteLink\":\"" + to(DeleteTempAttachment) + "?boardId=" + boardId + "\", \"photo\":" + photoJson + "}"; echoText(json); }