NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: MikeR on May 02, 2021, 12:36:03 AM

Title: Base64 Encode and Decode
Post by: MikeR on May 02, 2021, 12:36:03 AM
I have two Nettalk WebServers.
WebServer1 calls WebServer2 using a POST with a JSON PostData String.
WebServer2 returns a file (any File could be txt or PDF)
I have defined the return parameter as type StringTheory in the Webserver2 api.
In Webserver2 I create the file and load it into the stringtheory object.
I also do a Base64Encode.
In Webserver1 the calling program I load the returned value into a stringtheory object and do a Base64Decode.
Then I save it to disk.
If the returned file is txt this works fine.
But my pdf files are corrupt.(They cant be opened by adobe on the webserver1 machine. )
But they are created correctly and can open on the webserver2 machine.
There seems to be something going wrong in the encode and decode step that I dont understand.
 
Title: Re: Base64 Encode and Decode
Post by: rainerwallenius on May 02, 2021, 09:10:41 PM
Hi Mike

Try NoWrap, that solved my situation

:: rainer
Title: Re: Base64 Encode and Decode
Post by: Bruce on May 02, 2021, 10:59:22 PM
NoWrap is useful for headers and things, where line wrapping is not desired. But I don't think it will make a difference here.

I think your best bet Mike is to make a small example (well, I guess 2 apps) of what you are doing. My suspicion is that you are encoding, or decoding too many times.