WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> FTP Dynamic Naming
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1191540268

Message started by bgeoghan on Oct 5th, 2007 at 1:24am

Title: FTP Dynamic Naming
Post by bgeoghan on Oct 5th, 2007 at 1:24am
We need to issue a certain FTP command after a file has been uploaded via the FTP plugin.

The command needs to take the form of  :

QUOTE RCMD PUTDQ DQ(DATAQ) DATA(‘ffffffffffllllllllllmmmmmmmmmm’ 30) KEY(‘500’ 3)

where ffffffffff is the file name, llllllllll is the library and mmmmmmmmmm is blank.  The ‘ffffffffffllllllllllmmmmmmmmmm’  is positionally sensitive.  So, if we receive a file named test and need to put the file into a library testlib the command would be as follows :

QUOTE RCMD PUTDQ DQ(qqqqqqqq) DATA(‘test      testlib             ’ 30) KEY(‘500’ 3).  

I seen that there are commands to get a substring, etc.  Is there a way to ensure that the proper space padding
occurs on a dynamic basis?

Thanks,

Bill

Title: Re: FTP Dynamic Naming
Post by Gert on Oct 5th, 2007 at 1:39pm
Hi,

with dynamic naming you can use the {left} command to append spaces, for example
[code]{left{30,{filename}XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}[/code]
I used X-es here, but it works with spaces as well.

But wouldn't it be easier to run a server-side script that creates the command?

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.