Jump to content
php.lv forumi

Upload to ftp


LoyC

Recommended Posts

Vai kāds nevarētu palīdzēt izveidot nelielu scriptiņu, kas pēc pogas nospiešanas failu xxx.txt uploado uz ftp serveri pārrakstot iepriekšējo xxx.txt failu. Esmu meklējis tās ftp funkcijas, bet kaut kā īsti nemāku sasaistīt viņas kopā. Pieslēdzoties serverim vajag arī ielogoties tajā.

Link to comment
Share on other sites

Patiesībā, visu var izlasīt arī manuālī. Es domāju, apskatīt piemērus.

$conn = ftp_connect("ftp.domens.lv")or die("Konekcija izgāzās!");
ftp_login($conn,"lietotājvārds","parole")or die("Nesanāca ielogoties!");
$file = fopen("xxx.txt","r");
ftp_fput($conn,"xxx.txt",$file);
fclose($file);
ftp_close($conn);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...