[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to force destination directory ?
Hello Stéphane,
In your example, 'p1' is the name of the file on the remote server, and
'p2' is the name on the computer where FTPAPI is running.
So changing p1 to /TMP/73572.txt means that it's trying to put a file
named 73572.txt into a folder named /TMP on the remote server. If that
folder doesn't exist, of COURSE you'll get an error.
You haven't told us what the folder on the remote server /should/ be,
but the syntax should look something like this:
eval p1 = '/directory/on/server/73572.txt'
eval p2 = '/directory/on/client/73572.txt'
if ftp_put(sess: p1: p2)< 0
Or if you'd rather not code the directory into every request, you can do
this:
callp chdir('/directory/on/client')
callp ftp_chdir(sess: '/directory/on/server')
eval p1 = '73572.txt'
if ftp_put(sess: p1)< 0
.. check err ..
endif
eval p1 = '73573.txt'
if ftp_put(sess: p1)< 0
.. check err ..
endif
...etc...
On 7/28/2010 10:42 AM, Stéphane DELETREE wrote:
>
> Hello from France J
>
>
> First please be comprehensive, my English may be poor...
>
>
> I `m working with Scott examples on the PUT command.
>
> Here is my code sample :
>
>
> eval p1 = '/TMP/73572.txt'
> eval p2 = '73572.txt'
> if ftp_put(sess: p1: p2)< 0
> eval Msg = ftp_errorMsg(sess)
> dsply Msg
> endif
>
>
> I would like to send the "73572.txt" file to ftp server under Windows
> but I need to create the "TMP" directory under root on destination
> otherwise I get an error message "no such path or directory" L
>
> I tried with `/73572.txt" in p2 but it doesn't work better
>
> I hope it's clear enough for you to understand
>
>
> Best regards
>
>
> Stéphane.
>
>
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------