Link to home
Start Free TrialLog in
Avatar of dudez2
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.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd)&"fpdb\"&filename)
 
 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/"&filename)
response.write server.mappath("uploads/"&filename)

Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile server.mappath("fpdb\"&filename), 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!
ASKER CERTIFIED SOLUTION
Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dudez2
dudez2

ASKER

Thanks. Yes, this is a hosted web, so I will ask them...