Page 1 of 1
Move Files to another folder
Posted: Fri Jul 23, 2010 4:03 pm
by dantomlin
I have files on an FTP site which I can read no problem but after I do some processing, I want to move the files to another folder on the FTP site so they don't get processed a second time. I can copy and then delete or just move.
Any suggestions would be greatly appreciated....
Thanks, Dan
Re: Move Files to another folder
Posted: Sat Jul 24, 2010 10:23 am
by Mark
Hi Dan,
Try this:
Code: Select all
put "RNFR" && theDir & theFilename into myCommand
put libUrlFtpCommand(myCommand,myDomain,gUserName,gPassword) into rslt
put "RNTO" && theNewDir & theFilename into myCommand
put libUrlFtpCommand(myCommand,myDomain,gUserName,gPassword) into rsl
Best,
Mark
Re: Move Files to another folder
Posted: Fri Jul 30, 2010 5:59 pm
by dantomlin
I tried this and I'm getting the following errors which I don't really understand...
550 file unavailable, user profile has no access
553 could not rename file
Any ideas?
Thanks, Dan
Re: Move Files to another folder
Posted: Fri Jul 30, 2010 6:03 pm
by Mark
Dan,
Did you just copy and paste my example, or did you change it to accommodate your requirements? What I pasted really is nothing but an example, which should give you some idea of what you should do.
Best,
mark
Re: Move Files to another folder
Posted: Fri Jul 30, 2010 6:16 pm
by dantomlin
No, I put in the file, login and etc into the variables... here is the code, I just xx'ed out the username and password for purposes of posting
Code: Select all
put the cFileName of grp "FileInfo" into theFilename
put "/download/" into theDir
put "/download/processed" into theNewDir
put "67.210.32.14" into myDomain
put "xxxxxx" into tUserName
put "xxxxxx" into tPass
put "RNFR" && theDir & theFilename into myCommand
put libURLftpCommand(myCommand,myDomain,tUserName,tPass) into rslt
answer rslt
put "RNTO" && theNewDir & theFilename into myCommand
put libURLftpCommand(myCommand,myDomain,tUserName,tPass) into rsl
answer rsl
Re: Move Files to another folder
Posted: Fri Jul 30, 2010 8:04 pm
by dantomlin
It's working now... once I got the IT guy to give the correct writes to the user and I got my directories correct, the file is being moved.
Thanks for the help, it is greatly appreciated....
Dan
Re: Move Files to another folder
Posted: Fri Jul 30, 2010 8:15 pm
by Mark
Thank for letting me know that it works, Dan. I was just going to look into it.
Best,
Mark