Locked file handlers

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.
 
M

Mike Brind

Leon said:
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.

Hav you checked that the IUSR_Machinename acount has Modify permissions
for the directory containing the image files?
 
L

Leon Mayne

I"Mike Brind said:
Hav you checked that the IUSR_Machinename acount has Modify permissions
for the directory containing the image files?

Yes, the virtual directory is running under a domain account that full
access to the folder. It can also create new images if I specify a different
filename to save under, it just can't modify an existing file that has been
opened using ASPImage.
 
M

Mike Brind

Leon said:
Yes, the virtual directory is running under a domain account that full
access to the folder. It can also create new images if I specify a different
filename to save under, it just can't modify an existing file that has been
opened using ASPImage.

You'll need to talk to serverobject's support people, then.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top