Connecting Tech Pros Worldwide Forums | Help | Site Map

ftp_get save the file in the ServerSide

Newbie
 
Join Date: Jul 2008
Posts: 1
#1: Jul 28 '08
Sorry about my english but itīs not my first lenaguage.

i got a problem using ftp_get. My FTP server is working properly (I can upload and download files to it) but when I try to download a File using PHP code doesnīt seems work. The file is saved in the ServerSide instead clientSide. this is a portion of my code. $Local and $Remoto has the same name of file, without path, but donīt work wether add a path or not to $Local
I would appreciate some help.
thanks in Advance

Expand|Select|Wrap|Line Numbers
  1. function DescargarArchivos($Local, $Remoto)
  2. {        
  3.         $cid = ftp_connect("192.168.1.84");    
  4.         $resultado = ftp_login($cid, "anonymous", "");    
  5.         ftp_chdir($cid, "mauricio");    
  6.         $Descarga = ftp_get($cid, $Local, $Remoto, FTP_BINARY);
  7.         if($Descarga)
  8.         {
  9.             echo "download ssuccesfull";
  10.         }
  11.         else
  12.         {
  13.             echo "download not succesfull";
  14.         }
  15. }
  16.  

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,748
#2: Jul 28 '08

re: ftp_get save the file in the ServerSide


Hi. Welcome to Bytes!

Are you getting any errors?
If not, try the suggestions in this thread and see if that turns anything up.

P.S.
I notice that some of your code is written in another language. This is a very bad thing to get used to. What if you code were ever to be read by somebody that doesn't speak your language?
Having english as a 3rd language, I've cought myself doing this from time to time, but it can cause some seriouse problems.
It's just best, for everybody's sake, to always write programs in English, so there can be no confusion.
Reply