ftp always puts 1kb file on server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nancy Drew

    #1

    ftp always puts 1kb file on server

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

    $oFTPConn = ftp_connect($sF tpServer,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($oFTP Conn, $sFtpUserName, $sFtpPassWord) or
    die("Unable to connect to login to the FTP server: $sFTPServer!");
    $cmdUpload = ftp_put($oFTPCo nn, $sFullDestinati onPath, $_POST['srcFile'],
    FTP_BINARY);
    if ($cmdUpload != FTP_FINISHED){
    echo("There was an error uploading the file...");
    }
    $cmdCloseFTP = ftp_close($oFTP Conn);

    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?



  • Andy Hassall

    #2
    Re: ftp always puts 1kb file on server

    On Thu, 25 Nov 2004 09:55:03 -0500, "Nancy Drew" <genpub5@hotmai l.com> wrote:
    [color=blue]
    >this script used to upload files to the server without any issue:
    >
    > $oFTPConn = ftp_connect($sF tpServer,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($oFTP Conn, $sFtpUserName, $sFtpPassWord) or
    >die("Unable to connect to login to the FTP server: $sFTPServer!");
    > $cmdUpload = ftp_put($oFTPCo nn, $sFullDestinati onPath, $_POST['srcFile'],
    >FTP_BINARY);
    > if ($cmdUpload != FTP_FINISHED){
    > echo("There was an error uploading the file...");
    > }
    > $cmdCloseFTP = ftp_close($oFTP Conn);
    >
    >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?[/color]

    How big were you expecting them to be?

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Nancy Drew

      #3
      Re: ftp always puts 1kb file on server


      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:mskcq05d6j fjss3gt4e356sb4 cr8v5ngmf@4ax.c om...[color=blue]
      > On Thu, 25 Nov 2004 09:55:03 -0500, "Nancy Drew" <genpub5@hotmai l.com>[/color]
      wrote:[color=blue]
      >[color=green]
      > >this script used to upload files to the server without any issue:
      > >
      > > $oFTPConn = ftp_connect($sF tpServer,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($oFTP Conn, $sFtpUserName, $sFtpPassWord) or
      > >die("Unable to connect to login to the FTP server: $sFTPServer!");
      > > $cmdUpload = ftp_put($oFTPCo nn, $sFullDestinati onPath,[/color][/color]
      $_POST['srcFile'],[color=blue][color=green]
      > >FTP_BINARY);
      > > if ($cmdUpload != FTP_FINISHED){
      > > echo("There was an error uploading the file...");
      > > }
      > > $cmdCloseFTP = ftp_close($oFTP Conn);
      > >
      > >since the host company upgraded to php5, it appears to upload the files,[/color][/color]
      but[color=blue][color=green]
      > >they're always 1kb large? any idea what's going wrong?[/color]
      >
      > How big were you expecting them to be?[/color]

      anywhere from 5kb to about 150 kb
      [color=blue]
      >
      > --
      > Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
      > <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool[/color]


      Comment

      • Razzbar

        #4
        Re: ftp always puts 1kb file on server

        "Nancy Drew" <genpub5@hotmai l.com> wrote in message news:<jd6dnXDJ-txObDjcRVn-uw@rogers.com>. ..[color=blue]
        > this script used to upload files to the server without any issue:
        >
        > $oFTPConn = ftp_connect($sF tpServer,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($oFTP Conn, $sFtpUserName, $sFtpPassWord) or
        > die("Unable to connect to login to the FTP server: $sFTPServer!");
        > $cmdUpload = ftp_put($oFTPCo nn, $sFullDestinati onPath, $_POST['srcFile'],
        > FTP_BINARY);
        > if ($cmdUpload != FTP_FINISHED){
        > echo("There was an error uploading the file...");
        > }
        > $cmdCloseFTP = ftp_close($oFTP Conn);
        >
        > 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?[/color]

        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!

        Comment

        • Razzbar

          #5
          Re: ftp always puts 1kb file on server

          "Nancy Drew" <genpub5@hotmai l.com> wrote in message news:<jd6dnXDJ-txObDjcRVn-uw@rogers.com>. ..[color=blue]
          > this script used to upload files to the server without any issue:
          >
          > $oFTPConn = ftp_connect($sF tpServer,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($oFTP Conn, $sFtpUserName, $sFtpPassWord) or
          > die("Unable to connect to login to the FTP server: $sFTPServer!");
          > $cmdUpload = ftp_put($oFTPCo nn, $sFullDestinati onPath, $_POST['srcFile'],
          > FTP_BINARY);
          > if ($cmdUpload != FTP_FINISHED){
          > echo("There was an error uploading the file...");
          > }
          > $cmdCloseFTP = ftp_close($oFTP Conn);
          >
          > 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?[/color]

          Possibly you need to use this function:


          What type of OS on the server(s) are you loading to/from?

          Comment

          Working...