Re: CopyFile Object Required Error
From: Kirk (Kirk_at_discussions.microsoft.com)
Date: Mon, 20 Sep 2004 11:47:04 -0700
Thanks for the response. I still received the same error. On top of that, I
want to do this client side.
> "Kirk" <Kirk@discussions.microsoft.com> wrote in message
> > I have a web page where I want to allow the user to copy a file to a new
> > location.
> > I have the following code in a ASP page:
> > <script language="vbscript">
> > Function PlanCopy(WPA,PlanLoc)
> > Dim strRepLoc, fso
> > On Error Resume Next
> > strRepLoc = "\<server location and path to where file is to be copied>\"
> > strRepLoc = strRepLoc & WPA & "\"
> > Set fso = CreateObject("Scripting.FileSystemObject")
> > fso.copyfile PlanLoc,strRepLoc
> > If err.number <> 0 then
> > msgbox Err.number & vbCrLf & err.Description
> > exit function
> > end if
> > Set fso = Nothing
> > Set f = Nothing
> > msgbox "Your file: " & vbCrLf & PlanLoc & vbCrLf & " has been copied to: "
> > vbcrlf & strRepLoc,vbOKOnly
> > end function
> > </script>
> > Wherever this is executed, I receive a 424 Object Required error and I
> > seem to figure out why that is.
> > Anyone have any ideas? Am I missing something?
> > Any help would be appeciated.
> > Kirk
> Try Server.CreateObject()