NetTalk Central

Author Topic: Base64 Encode and Decode  (Read 1500 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Base64 Encode and Decode
« 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.
 

rainerwallenius

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • Email
Re: Base64 Encode and Decode
« Reply #1 on: May 02, 2021, 09:10:41 PM »
Hi Mike

Try NoWrap, that solved my situation

:: rainer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Re: Base64 Encode and Decode
« Reply #2 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.