Author Topic: Any File to Base64 - encoder and decoder  (Read 6773 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Any File to Base64 - encoder and decoder
« Reply #15 on: December 30, 2019, 01:40:40 pm »
Hey Andy can we run a compiled BAS program from DATA?

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Any File to Base64 - encoder and decoder
« Reply #16 on: December 30, 2019, 01:44:51 pm »
Hey Andy can we run a compiled BAS program from DATA?

Wouldn't you extract it, write it to disk, and then just SHELL to it and then KILL the temp file once it's finished?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Any File to Base64 - encoder and decoder
« Reply #17 on: December 30, 2019, 03:43:02 pm »
Wouldn't you extract it, write it to disk, and then just SHELL to it and then KILL the temp file once it's finished?

Yeah, almost right after I wrote that I realized of course it could be done and with any binary I would think (which is why Andy's problem with jpeg is curious) but why would we bother? Also there is a "huge" problem with even ogg files such as Auld Lang Syne that are too large to be practical to employ this method.

I'd say just zip the files into a package when ever you can.
« Last Edit: December 30, 2019, 03:45:16 pm by bplus »

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: Any File to Base64 - encoder and decoder
« Reply #18 on: December 30, 2019, 06:01:27 pm »
Hi guys,

In my mind it was perfectly clear that these encoded files should be small files (10K or less). I should have communicated that from the beginning but, forgot to do so. I originally made the b64 encoder/decoder file for just such small files for posting on forums that don't allow posting attachments. Then as a way to attach small files to forums to avoid inevitable 404's after expiring from free file/image sharing sites.

If transferring larger files then use a compression utility like 7z (free), RAR (commercial), or even ZIP (included with Windows 10).

Cheers :)

p.s.  @bplus
Ogg Vorbis is a variable bit-rate music encoder. It's most likely that the .ogg file you were wanting to use, is a high bit-rate file (256k/s or more)

Attached is a low VBR (variable bit-rate) version and a 185k version of xmas.png

 
« Last Edit: December 30, 2019, 11:21:22 pm by AndyA »