public void ProcessRequest(HttpContext context) { System.Diagnostics.Debugger.Break(); context.Response.ContentType = "image/JPEG"; System.Diagnostics.Debugger.Break(); string dirFullPath = HttpContext.Current.Server.MapPath("~/MediaUploader/"); string[] files; int numFiles; files = System.IO.Directory.GetFiles(dirFullPath); numFiles = files.Length; numFiles = numFiles + 1; string str_image = ""; foreach (string s in context.Request.Files) { HttpPostedFile file = context.Request.Files[s]; string fileName = file.FileName; string fileExtension = file.ContentType; if (!string.IsNullOrEmpty(fileName)) { fileExtension = Path.GetExtension(fileName); str_image = "MyPHOTO_" + numFiles.ToString() + fileExtension; //string pathToSave = HttpContext.Current.Server.MapPath("~/MediaUploader/") + str_image; //file.SaveAs(pathToSave); } } context.Response.Write(str_image); }
WebClient wc = new WebClient(); byte[] bytes = wc.DownloadData("Your URL" + ImageA.Remove(ImageA.IndexOf('\"'))); MemoryStream ms = new MemoryStream(bytes); System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)