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

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: 27.09.2025 - 09:45