This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes FTP upload Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "FTP upload " Watch "FTP upload " New topic
Author

FTP upload

Vino Kumar
Greenhorn

Joined: Mar 06, 2010
Posts: 7


I am trying to upload a file from PC to mainframe. I can able to do that successfully.
The file has 200 chars for each line. After uploading in mainframe I can see one line got broke and displayed as 2 lines.

How to make the file display as in original source.

Attached the code



Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Welcome to the Ranch!

Does that line contain any special characters? Perhaps a tab, or a carriage return (\r)?


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Vino Kumar
Greenhorn

Joined: Mar 06, 2010
Posts: 7
Thanks for the quick response.

The chars at the end of the line appear in the next line after uploading.

The alignment may not be as in the file. I couldnt attach the text file. The length of a line is 200 chars.
Spaces between chars that are highlighted in different colours



000946002-510A Endorsement1 00.046
000946004-578AIP Endorsement3 00.208
000935636-583D Endorsement6 00.091
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35248
    
    7
Try using binary mode instead of ASCII mode; the file should remain unchanged in that case.


Android appsImageJ pluginsJava web charts
Vino Kumar
Greenhorn

Joined: Mar 06, 2010
Posts: 7
While using binary, the file content is not readable in mainframe...
Vino Kumar
Greenhorn

Joined: Mar 06, 2010
Posts: 7
I guess the mainframe takes default record length 80. If so how to set record length as 200
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Which editor are you using?
Vino Kumar
Greenhorn

Joined: Mar 06, 2010
Posts: 7
I am not using any editor.. I looked at the inofrmation using i that says record length as 80..
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

And how did you look at that information?
Vino Kumar
Greenhorn

Joined: Mar 06, 2010
Posts: 7
Attached the image from host


[Thumbnail for host file info.JPG]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FTP upload
 
Similar Threads
How to upload file to ftp in java
553 Can't open that file: No such file or directory
FTP Dowload JPG & XML files only... USing com.oroinc.net.ftp.* from FTP server
FTP in Java
FTP am using Apache commons net