fonction ftp_fput PHP ()
Définition et utilisation
fonction ftp_fput () pour charger un fichier local a été ouvert, et sur le serveur FTP de l'enregistrer comme un fichier.
En cas de succès, la fonction retourne TRUE. Si elle échoue, elle retourne FALSE.
grammaire
ftp_fput(ftp_connection,remote,local,mode,resume)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
remote | 必需。规定上传到 FTP 服务器上保存的文件。 |
local | 必需。规定要上传的打开文件。 |
mode | 必需。规定传输模式。可能的值:
|
resume | 可选。规定在本地文件中的何处开始复制。默认是 0。 |
Exemples
Cet exemple est copié à partir du "source.txt" texte "target.txt" à:
<?php
$source = fopen("source.txt","r");
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_fput($conn,"target.txt",$source,FTP_ASCII);
ftp_close($conn);
?>
$source = fopen("source.txt","r");
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_fput($conn,"target.txt",$source,FTP_ASCII);
ftp_close($conn);
?>
Le code ci-dessus va afficher:
1
Remplissez PHP FTP Référence