The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
Unix PDF to Windows File Transfer |
Post Reply |
Author | |
svc007
Newbie Joined: April 08 2009 Location: Canada Status: Offline Points: 1 |
Post Options
Thanks(0)
Posted: April 08 2009 at 11:53pm |
When using FTD to transfer a PDF file in the Unix file system to my Windows Vista PC, the resulting PDF is very small compared to the original file. I then try to open it within Windows and it is corrupted. I used the binary option within FTD and have a Q-pointer that points to the Unix directory (unix:\path in attribute 3). How do I get around this problem?
|
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi svc007 -
The AccuTerm file transfer programs are written in Pick/BASIC, and that if probably the root of the problem. Depending on the host platform you are running, you may not be able to pass binary data (pdf file) through a BASIC program. There is nothing in the design of the FT program that would prevent passing binary data (assuming you have selected the binary transfer mode option), but the host file system and/or language implementation is probably to blame. Some platforms, such as Universe and QM, support full binary transparency in BASIC and in the file system. However, they both translate certain characters when accessing files in the Unix/Windows file system (LF -> AM), which corrupts binary data. I think there are some file options to prevent this, but I don't recall them off hand. Thanks, Pete |
|
atsantana
Newbie Joined: July 02 2007 Location: Brazil Status: Offline Points: 39 |
Post Options
Thanks(0)
|
Hi all.
I solved this problem transfering the file using resources of Linux (kermit) and Accuterm. I have used the script follow: EQU ESC TO CHAR(27) EQU STX TO CHAR(2) CMD = "!kermit -i -s /tmp/file.pdf" PRINT ESC:STX:"DKOB;C:\MyDir":CHAR(13) ; * enable the file transfer on Accuterm. EXECUTE CMD ; * transfer the file through Linux, using the "kermit" protocol. In this example, I transfer the "file.pdf" from /tmp to C:\MyDir. I hope I have helped. André Tuzi. São José do Rio Preto/SP - Brazil. |
|
Colvy
Newbie Joined: September 14 2015 Location: Arlington, TX Status: Offline Points: 9 |
Post Options
Thanks(0)
|
I ran the similar code as follows:
EQU ESC TO CHAR(27) EQU STX TO CHAR(2) CMD = "!kermit -i -s /work/test/ds181.pdf" PRINT ESC : STX : "DKOB;C:\Windows\Temp" : CHAR(13) ;* Enable the file transfer on Accuterm EXECUTE CMD ;* transfer the file through Linux using the Kermit protocol. It showed the "Kermit download in progress" pop-up window and then: ^A+"EAborting+ Verb "+"EABORTING+" is not in your VOC. It did not transfer the file form Linux to Windows. Does anyone have any suggestions? |
|
Colvy
|
|
Colvy
Newbie Joined: September 14 2015 Location: Arlington, TX Status: Offline Points: 9 |
Post Options
Thanks(0)
|
AccuTerm 7 help screens show "DOWNLOAD METHOD". Could this be the solution to copying a binary PDF file from Linux to Windows? I'm using UniVerse on a Linux box and Windows 10. Has anyone used it and are willing to share a program/script?
|
|
Colvy
|
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Colvy -
The Download method wont help you. It basically starts the AccuTerm side of a downlod operation, which is automatically handled when you use FT or FTSEND. The problem is that Universe translates AM <-> LF when accessing Type 1 or Type 19 files. If you can get your PDF file into a hashed Universe file (uncorrupted) and use Binary mode and Kermit protocol when transferring using FT or FTSEND, the target file would not be corrupted. Thanks, Pete |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
Hi Colvy -
I've had mixed results using the Linux or AIX command-line version of Kermit in an automated process. I have sometimes had success using a shell script that runs as a background process to run the kermit command, with a short "sleep" before starting kermit. But I have not had much luck invoking this from within an MV program. Thanks, Pete |
|
Colvy
Newbie Joined: September 14 2015 Location: Arlington, TX Status: Offline Points: 9 |
Post Options
Thanks(0)
|
I got it to work. Here is the logic I used in my UniVerse program:
ASSIGN 1 TO SYSTEM(1017) ;*** Required line, otherwise PDF gets corrupted! NEW.RECORD = "" READ SOURCE.REC FROM SLASH.WORK, "ds181.pdf" THEN NEW.RECORD = SOURCE.REC END ;*** End of Slash.Work read. WRITE NEW.RECORD ON SLASH.TEMP, "DS181.pdf" MODE = "K" ;*** A=ASCII, K=Kermit LINUX.FILE = "SLASH.TEMP" LINUX.ID = "DS181.pdf" PC.PATH = "C:\\Windows\Temp" PC.FILE = "DS181.pdf" EXECUTE "PTERM CASE NOINVERT" CALL FTSEND(MODE, LINUX.FILE, LINUX.ID, PC.PATH, PC.FILE, ITEM.COUNT, BYTE.COUNT, STAT) * Open PDF: PC.LOCATION = PC.PATH : "\" : PC.FILE PRINT '' : (ESC : STX : '<' : PC.LOCATION : CR) : ; * open PDF fil EXECUTE "PTERM CASE INVERT" In the above example, the SLASH.WORK file is a non-hashed file and the SLASH.TEMP file is a hashed type 3 file. I learned that if you use Binary mode with the Kermit protocol that FTSEND can send the binary file to the Windows PC. But, for UniVerse, the PDF must reside in a hashed file, or you need to prevent the automatic translation of AM <-> LF in Type 1 or Type 19 files. Peter Schellenbach found an undocumented use of ASSIGN 1 TO SYSTEM(1017) in the IBM U2 users list.
|
|
Colvy
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |