Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Base64 encode a file

Base64 encode a file

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hxhl95
    wrote on last edited by
    #1

    Hello everyone, So I'm trying to write a little proggy that base64 encodes any file. The thing is, most of the pieces of code I've found so far only encode strings (alphanumeric + symbols) and don't include any other chars that would possibly be in other types of files. However, I don't understand why. I understand that to base64 encode a string, all I have to do is read the string 6 bits at a time. But when I attempt to do the same thing with lets say a .doc or .zip file, it never comes out right. Any suggestions?

    S 1 Reply Last reply
    0
    • H hxhl95

      Hello everyone, So I'm trying to write a little proggy that base64 encodes any file. The thing is, most of the pieces of code I've found so far only encode strings (alphanumeric + symbols) and don't include any other chars that would possibly be in other types of files. However, I don't understand why. I understand that to base64 encode a string, all I have to do is read the string 6 bits at a time. But when I attempt to do the same thing with lets say a .doc or .zip file, it never comes out right. Any suggestions?

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      Look on CodeProject[^] - they often have useful, relevant articles[^].

      H 1 Reply Last reply
      0
      • S Stuart Dootson

        Look on CodeProject[^] - they often have useful, relevant articles[^].

        H Offline
        H Offline
        hxhl95
        wrote on last edited by
        #3

        :omg: I'm surprised I didn't find that. Thanks a lot :-D

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups