dudez2
asked on
Copy file fails with Permission Denied
I am trying to copy a recently uploaded file from one directory to another.
This is the code:
Set MyFile = ScriptObject.CreateTextFil e(Left(Ser ver.mappat h(Request. ServerVari ables("PAT H_INFO")), pathEnd)&" fpdb\"&fil ename)
For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next
MyFile.Close
Set MyFile=Nothing
Set ScriptObject=Nothing
Set UploadRequest=Nothing
response.write server.mappath("fpdb/"&fil ename)
response.write server.mappath("uploads/"& filename)
Set FSO = CreateObject("Scripting.Fi leSystemOb ject")
FSO.CopyFile server.mappath("fpdb\"&fil ename), server.mappath("uploads\"& filename), True
Set FSO = Nothing
And this is what I get:
Microsoft VBScript runtime error '800a0046'
Permission denied
/outputFile.asp, line 52
Line 52 is the FSO.CopyFile line.
Thanks!
This is the code:
Set MyFile = ScriptObject.CreateTextFil
For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next
MyFile.Close
Set MyFile=Nothing
Set ScriptObject=Nothing
Set UploadRequest=Nothing
response.write server.mappath("fpdb/"&fil
response.write server.mappath("uploads/"&
Set FSO = CreateObject("Scripting.Fi
FSO.CopyFile server.mappath("fpdb\"&fil
Set FSO = Nothing
And this is what I get:
Microsoft VBScript runtime error '800a0046'
Permission denied
/outputFile.asp, line 52
Line 52 is the FSO.CopyFile line.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER