Forum Moderators: open
imageURL = "\\SNAKE\Cobra\InetPub\Sites\" & websiteFolder & "\graphics\" & imageURL
dim originalImage As System.Drawing.Image = System.Drawing.Image.FromFile( imageURL ) Where SNAKE is the server name on the same domain and Cobra is the name of the drive (using the drive letter instead doesn't work).
Is this possible? The MSDN pages don't have any good examples, as usual. I tried passing it through Server.MapPath with no luck.
path = System.Web.HttpContext.Current.Request.MapPath("/graphics/ + imageURL);
if (System.IO.File.Exists(path) == false)
{
//File does not exist
System.Web.HttpContext.Current.Trace.Warn("path",path);
System.Web.HttpContext.Current.Trace.Warn("File does not exist");
return;
}
System.Drawing.Image originalImage = System.Drawing.Image.FromFile( path );
.
.
.
Dim imageURL As String = "\\SERVERNAME\Share\Test\Untitled.jpg"
Dim originalImage As System.Drawing.Image = System.Drawing.Image.FromFile(imageURL)
- What does your imageURL string contain at the point of loading the Image. (the reason being you have called it 'imageURL', is it a url?)
- Does your website (the Network Service user) have the correct permissions for this folder?
And, as Ocean10000 says, I would do the processing within a Try...Finally block (disposing of the Image in 'Finally' to free up resources)