Results 1 to 8 of 8

Thread: Base64 encoding

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    12

    Base64 encoding

    I am working on a project that requires data in a base64 format. I have a base64 encoding program that operates on text and works, but I don't know how to read a zipped file to make the base64 function work. Once the file is zipped, I do not know how to encode the zipped file to base64. Is there a VB6 function that operates on zipped files?

    This is my first time sending a request so it may be out there somewhere, but I did not see a sample in this forum.

    BigTee

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Base64 encoding

    Moved From The CodeBank

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Base64 encoding

    Just read the zip file into your program as binary (not text) into a single string. Send that string to the Base64 encoding sub and then save it as a Base64 encoded file. It's no different than encoding images or any file (including text) into Base64 if you read everything as binary.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    12

    Re: Base64 encoding

    Thank you for the information. But I do not know how to read a zipped file. I can open it with binary, but I need to know how to read/input the data to an array. If you have sample code that would be great.

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Base64 encoding

    Quote Originally Posted by BigTee View Post
    Thank you for the information. But I do not know how to read a zipped file. I can open it with binary, but I need to know how to read/input the data to an array. If you have sample code that would be great.
    Your original question was how to decode a zip file into a Base64, not how to open it and read the contents into an array. If all you want is to make the entire zip file Base64 encoded then why do you need to read the contents into an array?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    12

    Re: Base64 encoding

    That is the only way I know how to get the zipped file into a Base64 format. Some of the zipped files can be large. So what is the better way?

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Base64 encoding

    So what you want to do is to Base64 all of the files in the zip. I was under the impression that you wanted to Base64 the zip file itself (which it would with the included files) so that perhaps you were going to send it like an Email attachment. OK, so I think what you want to do is to make a new thread and ask how to open a zip file instead of this subject which asks how to do Base64 encoding.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    12

    Re: Base64 encoding

    I'm not sure I need to make a new thread. As I stated previoiusly, I want to Base64 encode a zipped file within a VB6 program so that that file can be sent in an email like format to a Web site. This file will be wrapped in commands that will tell the Web site what to do with the data. In this case, the data are medical claim data for insurance processing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width