Last post Aug 20, 2009 10:43 PM by theonlylawislove
Aug 20, 2009 08:55 PM|theonlylawislove|LINK
I have tried to research this error and I constantly come to the conclusing that the file is being used by another process, but this is not the case.
string finalPath = (HttpContext.Current.Server.MapPath(PRODUCT_IMAGE_PATH) + Path.GetFileName(imageSet.LargeImage.URL)).Replace(" ","").Replace("%","");
WebRequest request = HttpWebRequest.Create(imageSet.LargeImage.URL);
WebResponse response = request.GetResponse();
Stream responseStream = response.GetResponseStream();
System.Drawing.Bitmap dimage = new System.Drawing.Bitmap(responseStream);
Aug 20, 2009 10:13 PM|vcsjones|LINK
This can also occur if you don't have permission to save into the directory. Can you check and make sure the worker process have write permission to the directory?
Also, it appears all you are doing is loading an image from a response and saving it. Have you considering not using GDI at all?
Aug 20, 2009 10:43 PM|theonlylawislove|LINK
I needed the image object because I'm doing image resizing later.
The problem was that the finalpath actually didn't exists. I accidently replace " " with "" with the entire path rather than just the filepath. It would be great if the GDI gave me a useful error message, especially with something as simple as this.
Oh well. :)
Thanks for your time!