Page 1 of 1

FTP issue

Posted: Fri Oct 11, 2002 3:10 pm
by kendall
I have a coding question.
i was reviewing php.net's documentation on the ftp_get() function but it lacked some understanding as to the syntax of the local and remote files

which leads me to the following questions
i have in my code
------code-------
$download = ftp_get($serv, "C:\Windows\Desktop\$file","$DOCUMENT_ROOT/$file",FTP_BINARY);
----end---------
is this the syntax for the local and remote file path? (the files to be downloaded are in a separate folder to the programme)

if the syntax above is incorrect who does PHP know where i want my file saved to on the local disk?

if the local file does not exists will it create it as like fwrite() would?

when you say that ASCII mode is for text files. Do you mean ".txt" or do you mean text based doucments i.e. word, excel, pdf's?

i get a Warning ftp_get: no such file or directory, yet i specified an absolute path to the file why would i get this error? (chmod is set to 777)

FTP error

Posted: Fri Oct 11, 2002 5:12 pm
by kendall
Hi,

i have a question

isnt the ftp_get($serv,"local file","remote file",FTP_ASCII);

suppose to download the remote file to your harddrive on your PC like a normal FTP programm would?

is used this and all it did was create a copy right back on the local server

i even specified a "C:\Windows\Desktop\$localfile" and it created a copy right back on the server

i cant even delete the file

what is this function used for and what is the proper syntax path to use?

is it relative or absolute?

Kendall
P.S. HEEEEEEEEELLLLLLLLLLPPPPPPPPPPPPPPP :cry:

Posted: Fri Oct 11, 2002 5:19 pm
by hob_goblin
in the user comments:
no at sorry dot com
24-Aug-2002 07:17

<?

// example of a download
ftp_get($conn, "local.zip", "server.zip", FTP_BINARY);

?>
so, i don't think an absolute path is neccessary, as it will try to find the path from the FTP root...

FTP issue

Posted: Fri Oct 11, 2002 5:26 pm
by kendall
The Y did it copy the file right back on to the server instead of my hard drive like a normal FTP programm would?