protected async void btnUpload_Click(object sender, EventArgs e) { byte[] fileBytes = fileUpload.FileBytes; //Set your amend credentials //Amend.SetAmendName("Your-Amend-name"); //Amend.SetCredentials("Your-Access-Key", "Your-Access-Secret"); Amend.AmendResponse resp = await amend.UploadAsync(fileBytes); if (resp.StatusCode == 200) { Response.Redirect("ImageProcess.aspx?ImageId=" + resp.ImageName); } }
protected async void btnUploadChoose_Click(object sender, EventArgs e) { var id = hfImgId.Value.ToString(); var file = Server.MapPath("~/Images/" + id + ".jpg"); byte[] image = System.IO.File.ReadAllBytes(file); //Set your amend credentials //Amend.SetAmendName("Your-Amend-name"); //Amend.SetCredentials("Your-Access-Key", "Your-Access-Secret"); Amend.AmendResponse resp = await amend.UploadAsync(image); if (resp.StatusCode == 200) { Response.Redirect("ImageProcess.aspx?ImageId=" + resp.ImageName); } }