private static void Upload(HttpContext context) { context.Response.ContentType = "text/plain"; try { context.Response.Write("{ \"filename\": \"" + EditDefault.DoUpload(context) + "\"}"); } catch (Exception e) { context.Response.Write("{ \"error\": \"" + e.Message + "\"}"); } }
protected void Page_Load(object sender, EventArgs e) { var externalUrl = Request["fileUrl"]; if (!string.IsNullOrEmpty(externalUrl)) { FileName = EditDefault.DoUpload(externalUrl); } else { FileName = Request["fileID"]; } var type = Request["type"]; if (!string.IsNullOrEmpty(type)) { Try(type); Response.Redirect("doceditor.aspx?fileID=" + HttpUtility.UrlEncode(FileName)); } }