Hi Elaine,
IMHO, I suppose you have a problem to load your binaries in memory before the TU.DOWNLOAD.
If I do this :
A = ''
FOR I = 0 TO 255
A := CHAR(I)
NEXT I
ERR=''
CALL TU.DOWNLOAD(A,'C:\datas\A.BIN','BO','',ERR)
CRT 'ERR=':ERR
I get this on the pc side. The binaries are correct no one are corrupted, included 0xFF.
Same result on uv and on udt.
Can you try it ?
Regards.
------------------------------
Manu Fernandes
------------------------------
Original Message:
Sent: 06-17-2021 14:07
From: Elaine Litchfield
Subject: SBClient host to PC transfer of binary files
Thanks Manu. Funny thing, when I was researching this, I found a very old post of yours -- maybe on the u2 users' group? -- detailing the same method and I had already given that a try. Thanks for always being so helpful. For Unidata it transfers the file, but the resulting file on the client PC is corrupt.
------------------------------
Elaine Litchfield
Owner
Elaine Litchfield Consulting
Original Message:
Sent: 06-16-2021 08:13
From: Manu Fernandes
Subject: SBClient host to PC transfer of binary files
hello,
with Universe we do it like this :
B.DOWNLOAD.BIN SUBROUTINE B.DOWNLOAD.BIN(LOCALPATH,CLIENTPATH,RES) ****************************************************************** * Description of subroutine * DOWNLOAD A BIN FILE TO CLIENT VIA TU.DOWNLOAD * localpath ; LOCAL PATH OF BIN FILE * clientpath ; DESTINATION ON CLIENT SIDE * RES RESULT ****************************************************************** * RES = 0; BIN = ''; ERR = '' OPENSEQ LOCALPATH TO FV ELSE RES=STATUS() ; RETURN LOOP WHILE READBLK BUF FROM FV,512 DO BIN := BUF; BUF = '' REPEAT CALL TU.DOWNLOAD(BIN,CLIENTPATH,'BOZ','',ERR) RES = ERR RETURN
with udt you must use OSBREAD instead READBLK
I hope this help
------------------------------
Manu Fernandes
Original Message:
Sent: 06-15-2021 08:53
From: Doug Miller
Subject: SBClient host to PC transfer of binary files
Take a look at installing Samba on your server. It will allow you to mount a unix directory path as a network windows share and will probably be a cleaner solution. https://www.samba.org/
------------------------------
Doug Miller
Strategy 7
Original Message:
Sent: 06-14-2021 13:42
From: Elaine Litchfield
Subject: SBClient host to PC transfer of binary files
Has anyone successfully been able to transfer binary files from server to client through SBClient (UniData)?
It appeared to be possible to do a PD.LO using B and/or X options, and I tried also via UniBasic with OSREAD, but it does not work. I opened a recent Rocket support case on this and the official answer was, despite some initial success from Rocket's side, ultimately it isn't supported (SBXA-18778). Despite that news, I'm interested if anyone here has managed to get it working with (any version of) SBClient with some combination of luck and skill?
I have heard rumors it is possible if the file is uploaded through the client to the server in the first place, but that is not the case here. The use case is, small Excel files are generated for reporting on the server. The users would like to download these to their desktops. I could arrange alternate delivery, but they prefer saving on their PC. They are used to downloading .CSV files, which are text and transfer through SBClient without a problem. But once I gave them the Excel files, they love them and never want to see a .CSV again. Unfortunately because native Excel files are binary, the transfer fails.
------------------------------
Elaine Litchfield
Owner
Elaine Litchfield Consulting
------------------------------