FTP issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

FTP issue

Post 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)
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

FTP error

Post 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:
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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...
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

FTP issue

Post 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?
Post Reply