Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]ftp_get na inny serwer
Cr3dO
post
Post #1





Grupa: Zarejestrowani
Postów: 154
Pomógł: 0
Dołączył: 13.07.2007
Skąd: łódź

Ostrzeżenie: (0%)
-----


Hej poczytfalem troche o ftp : http://us3.php.net/manual/en/ref.ftp.php

i metodzie ftp_get()

jak zapisac plik zdalny na innym serwerze?

mam kod :

  1. <?php
  2. function returnPapImage ($name) {        
  3.            $server = 'bbs.pap.com.pl';
  4.            $user = 'login';
  5.            $password = 'haslo';
  6.            $local_file = $name;
  7.            $server_file = 'sgasiewski.pl/image.jpg';
  8.            $array = array();
  9.                
  10.            $ftpConnection = ftp_connect($server);
  11.            ftp_login($ftpConnection, $user, $password);
  12.            $file = ftp_get($ftpConnection, $local_file, $server_file, FTP_BINARY);    
  13.            
  14.            ftp_close($ftpConnection);
  15.            
  16.            return $file;
  17.        }
  18. ?>


plik pobieram z PAP a chce go zapisac do siebie : $server_file = 'sgasiewski.pl/image.jpg';
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Cr3dO
post
Post #2





Grupa: Zarejestrowani
Postów: 154
Pomógł: 0
Dołączył: 13.07.2007
Skąd: łódź

Ostrzeżenie: (0%)
-----


Cytat(erix @ 13.07.2009, 23:17:18 ) *



Ok, to dostep do pliku mamy juz zalatwiony ale i tak nie wysyla, blad :

(Object)#0
message = "faultCode:AMFPHP_RUNTIME_ERROR faultString:'ftp_get(): No such directory is available to you.' faultDetail:'/home/newagene/public_html/amfphp/services/newsgastro/NewsgastroServices.php on line 17'"
name = "Error"
rootCause = (null)

kod :

  1. <?php
  2. function returnPapImage ($name) {        
  3.            $server = 'bbs.pap.com.pl';
  4.            $user = 'user';
  5.            $password = 'haslo';
  6.            $local_file = $name;
  7.            $server_file = 'sgasiewski.pl/public_html/image.jpg';
  8.            $array = array();
  9.                
  10.            $ftpConnection = ftp_connect($server);
  11.            ftp_login($ftpConnection, $user, $password);
  12.            ftp_get($ftpConnection, $local_file, $server_file, FTP_BINARY);    
  13.            
  14.            ftp_close($ftpConnection);
  15.            
  16.            return $server_file;
  17.        }
  18. ?>



doimyslam sie czemu : nie loguje sie przeciesz u siebie tylko na papie ( skad pobieram plik )
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 05:02