The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Trouble with FTP

Discussion in 'General Discussion' started by sdg9, Apr 29, 2007.

  1. sdg9

    sdg9 Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    When I upload or download files via FTP I often lose the last 6 lines of code or so. I am not sure if this is related to cPanel but I have never seen this before on other pages I have worked with that don't use cPanel. When I view the copy on the server the last few lines are missing. Here is an example
    -------------------------
    Copy On My PC (Lines 140-152)
    -------------------------
    print "Blind Ship: ".$BlindShip."\n";
    print "Billing/Shipping Notes: ".$BillingShippingNotes."\n";
    print "Master Received?: ".$Master."\n";
    if ($Master eq "Other") {
    print " Expected: ".$MasterExpected."\n";
    }
    print "Artwork Received?: ".$Artwork."\n";
    if ($Artwork eq "Other") {
    print " Expected: ".$ArtworkExpected."\n";
    }
    print "Notes: ".$Notes."\n";
    print "</body></html>";
    -------------------------
    Copy Viewed from the Server
    -------------------------
    print "Blind Ship: ".$BlindShip."\n";
    print "Billing/Shipping Notes: ".$BillingShippingNotes."\n";
    print "Master Received?: ".$Master."\n";
    if ($Master eq "Other") {
    print " Expected: ".$MasterExpected."\n";
    }
    print "Artwork Received?: ".$Artwork."\n";
    if ($Art
    -------------------------
    Here the last 6 lines are cut off. I have used multiple ftp clients and nothing changes. Has anyone else experienced this?

    I upload an ASCII file and it looks like everything should work. I am using WinFTP at the moment. Below is the log of the upload

    COMMAND:> PWD
    257 "/public_html/cgi-bin" is your current location

    COMMAND:> TYPE A
    200 TYPE is now ASCII

    COMMAND:> PORT 140,88,85,181,13,217
    200 PORT command successful

    STATUS:> Open the data channel...
    COMMAND:> LIST
    150 Connecting to port 3545
    226-Options: -a -l
    226 9 matches total
    STATUS:> Receive 604kb in 15 milliseconds(40kb/s)¡£
     
  2. michaelst0ne

    michaelst0ne Registered

    Joined:
    May 28, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    check if you are downloading the file from the same
    location. May there is another copy of the file else where
    under your account.

    If you are downloading using your default FTP account,
    you will be connected to your home directory while actual web files
    will be stored in the public_html directory. I can't think of FTP
    behind the changes in the downloaded files.

    Michael
     
  3. sdg9

    sdg9 Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I am uploading to public_html/cgi-bin. In my ftp transfer window if I right click and view the cgi file on my computer it will show it as it should. I then copy it over to the cgi-bin folder on the server right click it and select view. Then the last few lines are cut off. I have never seen this before and don't know how to fix it.
     
  4. sdg9

    sdg9 Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I have been poking around with this some more. If I use WinFtp to view the uploaded file it is always cut off somewhere around line 150-160. Is there a max on the length of a cgi script? If I use WS_FTP to open the file it shows the entire file. The problem is that the server only acts upon what I see when I view it from WinFtp so my script is always cut off early. The strange thing is that the way my code is structured I essentially have the following

    Initialize variables
    Send email
    Print HTML code

    and the end of my HTML code is always cut off. If I rearrange the order so I print the HTML first

    Initialize variables
    Print HTML
    Send email

    then the last part of the email code is cut off. It runs fine on my local machine it just seems like the server doesn't recognize the entire file. Anyone else experience anything like this?
     
  5. sdg9

    sdg9 Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    well if I upload enough times I eventually get the entire script. It's really annoying but nothing makes sense to me. The bummer is that I thought my scripts were bad, it just can take more than one upload for it to work. Weird. It happened for HTML documents too.
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    One thing you could try is to use Passive FTP (PASV) mode in your FTP client. It might give you a more stable connection.
     
  7. Ankushforyou

    Ankushforyou Member

    Joined:
    Apr 16, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Use FTP on Passive Mode and also disable the Firewall on your computer .
     
Loading...

Share This Page