Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IndyFTP size restriction

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a file that I'm sending to an external agency. It is a text file where each record has a length of 1200.
Code:
MP  218   John Doe             123 Main St.
MP  218   Jane Johnson         312 S. Nowhere Ave
MP  218   Thomas Thompson      456 N. Anywhere

at the end of each record, I add enough ' ' until the length equals 1200.

When I transfer the file, (see code below), the name of the file I'm putting on the server also has to have a length of 1200. So again, I'm adding ' ' to the end of the file name string. However, when I pass strFileName to the Put procedure, it's too long!! I have added the site command prior to the put command (without the ' ' at the end of the file name) which I was told would set the correct length, but that didn't work either.

Any suggestions?

Leslie

Code:
procedure TfrmMain.TransferPaymentFile1Click(Sender: TObject);
var
  strFileName : string;
begin
  if frmMain.OpenDialog1.Execute then
  begin
    FTP_AOC.Connect(True);
    If FTP_AOC.Connected then
    begin
      FTP_AOC.ChangeDirUp;
      FTP_AOC.ChangeDir('FA1.MET.UPLOADS');
      //FTP_AOC.Site('lrecl=1200 blksize=0 recfm=fb cyl pri=1 sec=1');
      strFileName := 'G0001V04';
      while length(strFileName) < 1200 do
        strFileName := strFileName + ' ';
      FTP_AOC.Put(OpenDialog1.FileName, strFileName);
      FTP_AOC.Disconnect;
    end
    else
      ShowMessage('Not connected');
  end;
end;

 
Ok, I've been looking into this and think it may be on the receiving side, not my side. When I try to put the file, the error message is:

Project JMS.exe raised exception class EIdProtocolReplyError with message '500 Command failed - command to long'. Process stopped.

In checking into the EIdProtocolReplyError, it seems that it is returning the error from the receiving server. Any one know for sure?

Thanks,

Leslie
 
for some reason when I tried it again using the site command, the receiver indicated it arrived properly!

problem solved (I guess!)

les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top