sdg9

Registered
Apr 28, 2007
4
0
151
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)¡£
 

michaelst0ne

Registered
May 28, 2006
2
0
151
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
 

sdg9

Registered
Apr 28, 2007
4
0
151
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.
 

sdg9

Registered
Apr 28, 2007
4
0
151
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?
 

sdg9

Registered
Apr 28, 2007
4
0
151
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.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
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.