Locked file handlers

Discussion in 'ASP General' started by Leon Mayne, Sep 29, 2006.

  1. Leon Mayne

    Leon Mayne Guest

    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.
    Leon Mayne, Sep 29, 2006
    #1
    1. Advertising

  2. Leon Mayne

    Mike Brind Guest

    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
    Mike Brind, Sep 29, 2006
    #2
    1. Advertising

  3. Leon Mayne

    Leon Mayne Guest

    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.
    Leon Mayne, Sep 29, 2006
    #3
  4. Leon Mayne

    Mike Brind Guest

    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
    Mike Brind, Sep 29, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Kamoski
    Replies:
    1
    Views:
    2,441
  2. MrB
    Replies:
    1
    Views:
    2,163
  3. Keith
    Replies:
    0
    Views:
    521
    Keith
    Oct 1, 2003
  4. hkappleorange

    database file locked by aspx

    hkappleorange, Nov 6, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,717
  5. mishi_math
    Replies:
    11
    Views:
    15,550
    mishi_math
    Aug 26, 2003
Loading...

Share This Page