473,231 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

ftp always puts 1kb file on server

this script used to upload files to the server without any issue:

$oFTPConn = ftp_connect($sFtpServer,21,600) or die("Unable to connect ot
$sFTPServer!"); //login to the ftp server and upload the file //
$iFtpTimeOut = ftp_set_option($oFTPConn, FTP_TIMEOUT_SEC, 600);
$cmdLogin = ftp_login($oFTPConn, $sFtpUserName, $sFtpPassWord) or
die("Unable to connect to login to the FTP server: $sFTPServer!");
$cmdUpload = ftp_put($oFTPConn, $sFullDestinationPath, $_POST['srcFile'],
FTP_BINARY);
if ($cmdUpload != FTP_FINISHED){
echo("There was an error uploading the file...");
}
$cmdCloseFTP = ftp_close($oFTPConn);

since the host company upgraded to php5, it appears to upload the files, but
they're always 1kb large? any idea what's going wrong?

Jul 17 '05 #1
4 2907
On Thu, 25 Nov 2004 09:55:03 -0500, "Nancy Drew" <ge*****@hotmail.com> wrote:
this script used to upload files to the server without any issue:

$oFTPConn = ftp_connect($sFtpServer,21,600) or die("Unable to connect ot
$sFTPServer!"); //login to the ftp server and upload the file //
$iFtpTimeOut = ftp_set_option($oFTPConn, FTP_TIMEOUT_SEC, 600);
$cmdLogin = ftp_login($oFTPConn, $sFtpUserName, $sFtpPassWord) or
die("Unable to connect to login to the FTP server: $sFTPServer!");
$cmdUpload = ftp_put($oFTPConn, $sFullDestinationPath, $_POST['srcFile'],
FTP_BINARY);
if ($cmdUpload != FTP_FINISHED){
echo("There was an error uploading the file...");
}
$cmdCloseFTP = ftp_close($oFTPConn);

since the host company upgraded to php5, it appears to upload the files, but
they're always 1kb large? any idea what's going wrong?


How big were you expecting them to be?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:ms********************************@4ax.com...
On Thu, 25 Nov 2004 09:55:03 -0500, "Nancy Drew" <ge*****@hotmail.com> wrote:
this script used to upload files to the server without any issue:

$oFTPConn = ftp_connect($sFtpServer,21,600) or die("Unable to connect ot
$sFTPServer!"); //login to the ftp server and upload the file //
$iFtpTimeOut = ftp_set_option($oFTPConn, FTP_TIMEOUT_SEC, 600);
$cmdLogin = ftp_login($oFTPConn, $sFtpUserName, $sFtpPassWord) or
die("Unable to connect to login to the FTP server: $sFTPServer!");
$cmdUpload = ftp_put($oFTPConn, $sFullDestinationPath, $_POST['srcFile'],FTP_BINARY);
if ($cmdUpload != FTP_FINISHED){
echo("There was an error uploading the file...");
}
$cmdCloseFTP = ftp_close($oFTPConn);

since the host company upgraded to php5, it appears to upload the files, butthey're always 1kb large? any idea what's going wrong?
How big were you expecting them to be?


anywhere from 5kb to about 150 kb

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Jul 17 '05 #3
"Nancy Drew" <ge*****@hotmail.com> wrote in message news:<jd********************@rogers.com>...
this script used to upload files to the server without any issue:

$oFTPConn = ftp_connect($sFtpServer,21,600) or die("Unable to connect ot
$sFTPServer!"); //login to the ftp server and upload the file //
$iFtpTimeOut = ftp_set_option($oFTPConn, FTP_TIMEOUT_SEC, 600);
$cmdLogin = ftp_login($oFTPConn, $sFtpUserName, $sFtpPassWord) or
die("Unable to connect to login to the FTP server: $sFTPServer!");
$cmdUpload = ftp_put($oFTPConn, $sFullDestinationPath, $_POST['srcFile'],
FTP_BINARY);
if ($cmdUpload != FTP_FINISHED){
echo("There was an error uploading the file...");
}
$cmdCloseFTP = ftp_close($oFTPConn);

since the host company upgraded to php5, it appears to upload the files, but
they're always 1kb large? any idea what's going wrong?


By 'host company' do you mean the server you are sending -to- or the
one you are sending -from-?

Have you verified that the files uploaded really are 1K, or perhaps
you are getting a quirky directory reading?

Interesting problem!
Jul 17 '05 #4
"Nancy Drew" <ge*****@hotmail.com> wrote in message news:<jd********************@rogers.com>...
this script used to upload files to the server without any issue:

$oFTPConn = ftp_connect($sFtpServer,21,600) or die("Unable to connect ot
$sFTPServer!"); //login to the ftp server and upload the file //
$iFtpTimeOut = ftp_set_option($oFTPConn, FTP_TIMEOUT_SEC, 600);
$cmdLogin = ftp_login($oFTPConn, $sFtpUserName, $sFtpPassWord) or
die("Unable to connect to login to the FTP server: $sFTPServer!");
$cmdUpload = ftp_put($oFTPConn, $sFullDestinationPath, $_POST['srcFile'],
FTP_BINARY);
if ($cmdUpload != FTP_FINISHED){
echo("There was an error uploading the file...");
}
$cmdCloseFTP = ftp_close($oFTPConn);

since the host company upgraded to php5, it appears to upload the files, but
they're always 1kb large? any idea what's going wrong?


Possibly you need to use this function:
http://www.php.net/manual/en/function.ftp-alloc.php

What type of OS on the server(s) are you loading to/from?
Jul 17 '05 #5

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

Similar topics

1
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,...
8
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) {...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
2
by: valerio | last post by:
Hi all, I've some problem to import data to DB2 using the db2move and db2look tools. Follow the problem : I have exported data from db2 v. 7 database on windows server, using the db2look and...
12
by: Phoe6 | last post by:
The Program Fragment is this: int choice; /* Users Input Command */ .. .. .. printf("Enter a command: "); fflush(stdin); choice = getc(stdin); printf("\n");
36
by: Debaser | last post by:
I've recently read in one of my old C books that puts() is a better function call with regard to performance than printf() in the following situation: puts("Some random text"); vs. ...
4
by: Rodo | last post by:
Hi all, I'm new to this whole thing. I have a bunch of text files that are created by a software at work that keeps info one of our products. Each unit being calibrated gets a "record" (track by...
9
by: anon.asdf | last post by:
In terms of efficieny: Is it better to use multiple putchar()'s after one another as one gets to new char's OR is it better to collect the characters to a char-array first, and then use...
16
by: Jonathan Wood | last post by:
Greetings, I was wondering if anyone here has a good understaning of the Session object. I know there are options like the Session.Abandon method and the regenerateExpiredSessionId setting,...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.