L
Leon Mayne
Hi all,
We had to move a legacy ASP app to an IIS6 server and now the app has
stopped working. Basically the offending script opens an image on a network
share, rotates the image, and then saves it back to the original filename.
Unfortunately as soon as the script touches the file it seems to lock it and
writing the rotated image back to the file fails. After that it becomes
impossible to delete the file off the remote server as it is marked as in use
by another application. It doesn't seem to have anything to do with the fact
the image is on a share, as the problem happens when I try it with a local
file as well.
Anyone know what's wrong? Sample code:
set objImage = Server.CreateObject("AspImage.Image")
set objFSO = CreateObject("Scripting.FileSystemObject")
strPhysPath = "C:\temp\test.JPG"
if objImage.LoadImage(strPhysPath) then
response.Write("Opened image OK<br>")
objImage.RotateImage(-90)
if objImage.SaveImage then
response.Write("Saved image ok")
else
response.Write("Could not save image")
end if
else
response.Write("Could not open image<br>")
end if
P.S. The script uses ServerObjects.com's AspImage object.
We had to move a legacy ASP app to an IIS6 server and now the app has
stopped working. Basically the offending script opens an image on a network
share, rotates the image, and then saves it back to the original filename.
Unfortunately as soon as the script touches the file it seems to lock it and
writing the rotated image back to the file fails. After that it becomes
impossible to delete the file off the remote server as it is marked as in use
by another application. It doesn't seem to have anything to do with the fact
the image is on a share, as the problem happens when I try it with a local
file as well.
Anyone know what's wrong? Sample code:
set objImage = Server.CreateObject("AspImage.Image")
set objFSO = CreateObject("Scripting.FileSystemObject")
strPhysPath = "C:\temp\test.JPG"
if objImage.LoadImage(strPhysPath) then
response.Write("Opened image OK<br>")
objImage.RotateImage(-90)
if objImage.SaveImage then
response.Write("Saved image ok")
else
response.Write("Could not save image")
end if
else
response.Write("Could not open image<br>")
end if
P.S. The script uses ServerObjects.com's AspImage object.