473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Locked file handlers

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.
Sep 29 '06 #1
3 1682

Leon Mayne wrote:
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?

--
Mike Brind

Sep 29 '06 #2
I"Mike Brind" wrote:
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.
Sep 29 '06 #3

Leon Mayne wrote:
I"Mike Brind" wrote:
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.
You'll need to talk to serverobject's support people, then.

--
Mike Brind

Sep 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Cameron | last post by:
How can you tell if a file is locked/being written to by another process? -Cam
4
by: hkappleorange | last post by:
I ued this code to connect to a mdb file A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=C:\Inetpub\wwwroot\ASPX\Authors.mdb" )
6
by: elake | last post by:
I found this thread about a pst file in Windows being locked and I am having the same issue. ...
3
by: guybenron | last post by:
Hey, I have a sort of petty-neurotic question, I'm kinda pedantic and like to keep my log directories clean, and this thing is bothering me to the point of actually posting a question (couldn't...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.