Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > File Transfer
  New Posts New Posts RSS Feed - Unix PDF to Windows File Transfer
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedUnix PDF to Windows File Transfer

 Post Reply Post Reply
Author
Message
svc007 View Drop Down
Newbie
Newbie


Joined: April 08 2009
Location: Canada
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote svc007 Quote  Post ReplyReply Direct Link To This Post Topic: Unix PDF to Windows File Transfer
    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?
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: April 15 2009 at 8:15am
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
Back to Top
atsantana View Drop Down
Newbie
Newbie


Joined: July 02 2007
Location: Brazil
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote atsantana Quote  Post ReplyReply Direct Link To This Post Posted: August 12 2009 at 1:52am
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.
Back to Top
Colvy View Drop Down
Newbie
Newbie
Avatar

Joined: September 14 2015
Location: Arlington, TX
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Colvy Quote  Post ReplyReply Direct Link To This Post Posted: March 16 2016 at 8:03am
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
Back to Top
Colvy View Drop Down
Newbie
Newbie
Avatar

Joined: September 14 2015
Location: Arlington, TX
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Colvy Quote  Post ReplyReply Direct Link To This Post Posted: June 16 2016 at 6:19am
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
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: June 20 2016 at 9:27am
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

Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: June 20 2016 at 11:50am
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

Back to Top
Colvy View Drop Down
Newbie
Newbie
Avatar

Joined: September 14 2015
Location: Arlington, TX
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Colvy Quote  Post ReplyReply Direct Link To This Post Posted: June 21 2016 at 7:04am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.