So, if I used that debug code you gave us in one of the previous posts in this thread to determine the actual full path, and then substituted that I wouldnt need to use realpath and it would work? Even with a variable from a recordset as the filename as in my example here?