Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ftp_put(3) [php man page]

FTP_PUT(3)								 1								FTP_PUT(3)

ftp_put - Uploads a file to the FTP server

SYNOPSIS
bool ftp_put (resource $ftp_stream, string $remote_file, string $local_file, int $mode, [int $startpos]) DESCRIPTION
ftp_put(3) stores a local file on the FTP server. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $remote_file - The remote file path. o $local_file - The local file path. o $mode - The transfer mode. Must be either FTP_ASCII or FTP_BINARY. o $startpos -The position in the remote file to start uploading to. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ftp_put(3) example <?php $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file "; } else { echo "There was a problem while uploading $file "; } // close the connection ftp_close($conn_id); ?> SEE ALSO
ftp_pasv(3), ftp_fput(3), ftp_nb_fput(3), ftp_nb_put(3). PHP Documentation Group FTP_PUT(3)

Check Out this Related Man Page

FTP_PASV(3)								 1							       FTP_PASV(3)

ftp_pasv - Turns passive mode on or off

SYNOPSIS
bool ftp_pasv (resource $ftp_stream, bool $pasv) DESCRIPTION
ftp_pasv(3) turns on or off passive mode. In passive mode, data connections are initiated by the client, rather than by the server. It may be needed if the client is behind firewall. Please note that ftp_pasv(3) can only be called after a successfull login or otherwise it will fail. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $pasv - If TRUE, the passive mode is turned on, else it's turned off. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ftp_pasv(3) example <?php $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // turn passive mode on ftp_pasv($conn_id, true); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file "; } else { echo "There was a problem while uploading $file "; } // close the connection ftp_close($conn_id); ?> PHP Documentation Group FTP_PASV(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to upload to the unix server?

I am having problems uploading files to my new server. I am new at this so im sure im doing it wrong. I tried using wsftp but that didnt work. please help me!! (4 Replies)
Discussion started by: rdog157h
4 Replies

2. Shell Programming and Scripting

Help in FTP'ing multiple files

Hi, I have written the following FTP script to get the multiple files from remote server to local server. My problem is that 'mget *' is not working in the script. I also tried with 'mget *.txt', 'mget *.*' etc. without any success. It do not copy any file to local server. In the script, Prompt... (10 Replies)
Discussion started by: berlin_germany
10 Replies

3. Shell Programming and Scripting

changing permission using FTP

Dear all, i want to change file permision of remote dir using FTP. is that possible? what i'm doing is i'm simply doing chmod 777 filename after establishing the connection with remote server using ftp... but the result showing is 550 SITE CHMOD command failed. can any body plz help?... (3 Replies)
Discussion started by: panknil
3 Replies

4. Solaris

FTP problem

Hi Guys, Got problem when I tried to get files from Solaris server to my PC. The connection transfer was using FTP and the connection was made from the solaris server to my PC. Here's what happened when the file transfer being made: # ftp 10.192.23.230 Connected to 10.192.23.230. 220... (9 Replies)
Discussion started by: raskita
9 Replies

5. Shell Programming and Scripting

Sed problem

Hi guys, I have a problem where by I need to remane a file by moving it to another location. For instance I have a file called change.txt changeA.txt changeB.txt and I need to change the name to change_a1.txt changeA_a2.txt changeB_a3.txt I need a sed regular expression that changes... (3 Replies)
Discussion started by: abch624
3 Replies

6. UNIX for Dummies Questions & Answers

Replacing string

Hi there, I'd like to replace STRING_ZERO in FILE_ZERO.txt with the value of VALUEi-th by using something like that: VALUE1=1000 VALUE2=2000 VALUE3=3000 for((i=1;i<=3;i++)); do sed "s/STRING_ZERO/$VALUE'$i'/" FILE_ZERO.txt >> FILE_NEW.txt; done but it doesn't work... Any help... (9 Replies)
Discussion started by: Giordano Bruno
9 Replies

7. UNIX for Dummies Questions & Answers

Rename FILE with sysdate-1

Hi, There is file on UNIX server named as fd40568-07082009.txt which get FTP'ed to UNIX on a daily basis. 07082009 of fd40568-07082009.txt represents the system date. This type of .txt gets FTP on a daily basis. My requirement is to rename the fd40568-07082009.txt to fd40568-07072009.txt... (2 Replies)
Discussion started by: rahulbahulekar
2 Replies

8. Shell Programming and Scripting

change the mode of the file after FTP

Hi I am FTPing a file to a remote server from my local server. But after I FTP it the permissions are not in executable option, I need to change the permissions of the FTPed file how can i do that. Below is my script LOCALDIR=/batch/ediprocess LOCAL_BACKUP_DIR/batch/ediprocessBackUp... (4 Replies)
Discussion started by: shanth_chandra
4 Replies

9. Shell Programming and Scripting

FTP Error 553 I/O error.

Hi All, I have a problem when uploading txt file from windows to Unix server. I got 533 I/O error. I am using .bat file and it works for other batches but with this particular batch it doesn't work. thanks guys for helping in advance. (2 Replies)
Discussion started by: sfaqih
2 Replies

10. Shell Programming and Scripting

Transfer output to empty file?

Hi all, I want transfer the echo data into file.txt.how? echo " $dir $group " >> ${file.txt} ---------- Post updated at 04:11 PM ---------- Previous update was at 03:10 PM ---------- anybody can help ? i mean in script output like echo " hello" i want transfer that output to file.txt. (4 Replies)
Discussion started by: proghack
4 Replies

11. Shell Programming and Scripting

How to FTP the latest file, based on date, from a remote server through a shell script?

How to FTP the latest file, based on date, from a remote server through a shell script? I have four files to be FTP'ed from remote server. They are of the following format. build1_runtime_mmddyyyy.txt build2_runtime_mmddyyyy.txt build3_runtime_mmddyyyy.txt buifile_count_mmddyyyy.txt ... (9 Replies)
Discussion started by: imran_affu
9 Replies

12. Shell Programming and Scripting

FTP a file on Hourly basis

Hi, I have to upload a file test_201105281100.txt to a ftp location. The files will be created on hourly basis like test_201105281100.txt, test_201105281200.txt & so on. After a file is uploaded successfully, I need to rename the file as test_201105281100.success & if it is not uploaded... (11 Replies)
Discussion started by: SunilB2011
11 Replies

13. Solaris

Hung ILOM - e2900

While trying to perform a firmware upgrade on this ilom, the system refused to allow uploading of more than ~900k or so... We tried multiple approaches using FTP and all failed. I decided to start this morning by firing up Apache on another box and trying the same process via HTTP but when I went... (8 Replies)
Discussion started by: DustinT
8 Replies

14. Red Hat

Files copied to FTP server not shown

I had copied 2 files to an FTP server which I deployed on my RHEL 5.8 server. The ownership I kept for the files are for the user, ftp. But, I do not see the files on the FTP location using either accessing through Windows explorer or the browser. The ftp location is ftp://10.101.17.80/incoming.... (7 Replies)
Discussion started by: RHCE
7 Replies

15. Programming

QFTP connection refused problem in WEC7

Hi I tried FTP transfer from WEC7(Windows Embedded Compact 7) to another windows 7.I am getting the connection refused error. Could you please help me to resolve this. what are the reasons one person can get connection refused while trying to connect through QFTP. Tool : Qt 4.8 Thank... (4 Replies)
Discussion started by: SA_Palani
4 Replies