473,657 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with ftp_put and ftp_get

I'm trying to make simple ftp client, used the following article for base:
http://www.devarticles.com/c/a/PHP/B...nt-With-PHP/3/

All works, I can login, see list of files, but except ftp_put and ftp_get
functions. They return always false. I tried to set passive mode, it doesn't
help.

Any advice will be appreciated.
Dec 5 '05 #1
5 5520
All works, I can login, see list of files, but except ftp_put and ftp_get
functions. They return always false. I tried to set passive mode, it doesn't
help.


Code? Have you tried removing the "@" error-suppressing character from
the function calls and letting PHP tell you it thinks the problem is?

---
Steve

Dec 5 '05 #2
I tried, but it doesn't work, echo gives nothing.

$putFile = ftp_put($conn, $remotefile, $localfile, FTP_BINARY);

echo $putFile;

"Steve" <go********@nas tysoft.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
All works, I can login, see list of files, but except ftp_put and ftp_get
functions. They return always false. I tried to set passive mode, it
doesn't
help.


Code? Have you tried removing the "@" error-suppressing character from
the function calls and letting PHP tell you it thinks the problem is?

---
Steve

Dec 5 '05 #3
Code? Have you tried removing the "@" error-suppressing character from
the function calls and letting PHP tell you it thinks the problem is?
I tried, but it doesn't work, echo gives nothing.


Odd. Have you enabled error reporting and display?

ini_set('error_ reporting', E_ALL);
ini_set('displa y_errors', TRUE);
---
Steve

Dec 5 '05 #4
insert it, same result

"Steve" <go********@nas tysoft.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
> Code? Have you tried removing the "@" error-suppressing character from
> the function calls and letting PHP tell you it thinks the problem is?

I tried, but it doesn't work, echo gives nothing.


Odd. Have you enabled error reporting and display?

ini_set('error_ reporting', E_ALL);
ini_set('displa y_errors', TRUE);
---
Steve

Dec 6 '05 #5
I had some issues when I was working on an FTP program for a client of
mine as well. I switched it around and used ftp_fput, which works with
an open file stream, and that seemed to clear up my issues. The main
thing was to open the file first, then upload it.

http://us3.php.net/manual/en/function.ftp-fput.php

Dec 9 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1799
by: Joseph Markovich | last post by:
I'm trying to write a script for my users to be able to upload large files, and now I am unsure what exactly I am doing wrong. My script is based on the one in the PHP manual. <?php if(isset( $Submit )) { $ftp_server = "ftp_site"; $ftp_user_name = "username"; $ftp_user_pass = "password";
0
1958
by: John | last post by:
Are there any precautions that I should take when downloading a file from a remote file on Linux platform to a local file in Win98 platform? I am using the method ftp_get $remotefile = '../products.txt'; $localfile = 'C:/data/products.txt'; ftp_get($conn, $localfile, $remotefile, FTP_ASCII)) Thank you John
1
4656
by: balzano_1 | last post by:
Hi, im trying to upload a file from a client (windows) to an ftp server (linux), i deciede to use some of php`s functions to connect and authenticate etc.. i only wish to put a file on the server, so i used ftp_put() function, when i send the file via http, the file is created on the server, but it is empty, i checked the permissions and all are set correctly, i figured if it is empty it means it cant find the file im trying to upload, i...
2
2623
by: Udo Pecher | last post by:
I apply the following code test.php $upload =ftp_put($conn_id,"test.jpg","$dat",FTP-BINARY); where $dat is a local filename which I like to move via FTP. "test.jpg" ist the filename on the Web-Server. I start this php-code from HTML with <FORM ENCTYPE="multipart/form-data" ACTION="test.php" METHOD=POST > .....
0
1677
by: rstuckart | last post by:
A script successfully connects to a remote server, logs in, reports the size of a file on the server. The problem is that it will not download the file with either ftp_get or ftp_fget. The Configure Command shows: --enable-safe-mode, but safe_mode is OFF, safe_mode_exec_dir has no value, safe_mode_gid is ON, safe_mode_include_dir and open_basedir each have no value. Function set_time_limit() runs without complaint, so I am fairly...
5
6742
by: tripwater | last post by:
Hello, I am having problems with the ftp_put() function. I can login via shell prompt. Does anyone know why the ftp_put() function may not work? I went to the php site and followed the directions. I am connecting because I am not getting an error. I am also logging in with the username and password because I am not getting an error here as well. But so far no matter what I do, the file will not upload. Any help with this would be...
1
1969
by: ralphNOSPAM | last post by:
I'm trying to download a text file named KLAX.TXT at tgftp.nws.noaa.gov using if (ftp_get($conn_id, "Metar Reports/$local_file", $server_file, FTP_BINARY)) { print "Success";
2
1705
by: cxian | last post by:
Hi all, I am trying to download files from a remote with the use of ftp_get. Somehow, the script always return to false. Here's what I got: $conn_id = ftp_connect($ftp_host); $login_result = ftp_login($conn_id, $ftp_username, $ftp_password);
1
1770
by: irfan.mohammed | last post by:
Dear All, I need your help,i am using ftp_get for getting the file from remote machine.now i am able to save only at one location.i want the user to select the directory any where in the computer and able to save it. Thanks in advance Irfan
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.