Menu

#12 Upload file sends file binary

open
nobody
None
5
2006-06-26
2006-06-26
Shadax
No

When trying to upload a text file from a windows
machine to a non ascii (iSeries) machine, the file is
always uploaded in binary mode.

The problem is the piece of code below

FTPConnection.java:
public void uploadFile(FTPFile fromFile, FTPFile
toFile,boolean resume)
throws IOException, FtpWorkflowException, FtpIOException
{
..
//Send TYPE I
Command commandType = new Command(Command.TYPE_I);
(sendCommand(commandType)).dumpReply();
..
}

Removing this piece of code seems to solve the problem.

The FTPFile has a methode setTransferType which does
not seem to be used.

Discussion

  • Nachoes

    Nachoes - 2006-08-04

    Logged In: YES
    user_id=1561119

    Well you could always use setTransferType(boolean) (from
    your FTPConnection object) to manually force binary or ascii
    transfers.

     
  • Nachoes

    Nachoes - 2006-08-04

    Logged In: YES
    user_id=1561119

    Ignore my last comment, the code you've pasted would still
    be executed.

     

Log in to post a comment.