473,698 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Base64 Decoding

Hi All,

Could you please give me some guidelines on dealing with
Base64 encoded string.
The actual purpose is to decode Base64 Encoded string
and stream the data to a browser so that it can be viewed
in a web application

Regards,
Kuldeep
Aug 30 '06 #1
2 7368
Not sure what exactly you are looking for. If you are finding a way to
decode a base64 string, use Convert.FromBas e64String()

"Kuldeep" <ku************ ****@hotmail.co mwrote in message
news:uw******** ******@TK2MSFTN GP04.phx.gbl...
Hi All,

Could you please give me some guidelines on dealing with
Base64 encoded string.
The actual purpose is to decode Base64 Encoded string
and stream the data to a browser so that it can be viewed
in a web application

Regards,
Kuldeep
Aug 30 '06 #2
public static string Base64Encode(st ring data) {
byte[] myBytes = Encoding.ASCII. GetBytes(data.T rim().ToCharArr ay());
return Convert.ToBase6 4String (myBytes);
}

public static string Base64Decode(st ring data) {
try {
return Encoding.ASCII. GetString (Convert.FromBa se64String (data.Trim()));
} catch {
// Invalid String!
return "";
}
}

"Kuldeep" wrote:
Hi All,

Could you please give me some guidelines on dealing with
Base64 encoded string.
The actual purpose is to decode Base64 Encoded string
and stream the data to a browser so that it can be viewed
in a web application

Regards,
Kuldeep
Oct 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4220
by: Ramy076 | last post by:
I have a C App which uses openssl for Encoding and decoding which needs to be ported to java. The decoded text does not match between the C App and the java App. The size of the output itself is wrong. I think i am doing something basically wrong. pls help. Output is not the same as seen here because of special characters Output from C: is only 12 bytes long
1
8096
by: Oliver Kurz | last post by:
Hello, I have a problem by converting a string to base64 and back again. I have a string with german special chars like äöüß. This string i convert with base64str=base64.encode('äöüß') into a base64 representation. Backwards I got an error:
27
15035
by: gRizwan | last post by:
Hello all, We have a problem on a webpage. That page is sent some email data in base64 format. what we need to do is, decode the base64 data back to original shape and extract attached image from it. Any help will be highly appriciated. Thanks
7
6791
by: Julia | last post by:
Hi I am trying to pass an encoded string to a JavaScript the following is the C# code which convert the string STRING_TO_ENCODE to base64 byte bytIn = System.Text.UnicodeEncoding.Unicode.GetBytes(STRING_TO_ENCODE); string result=System.Convert.ToBase64String
14
4342
by: BB | last post by:
Hello. i am trying to decode a block of (what i think is) base64 into text, and i have NO idea how to begin. I'm going to paste the whole string here, but i want to know the steps necessary to convert it to text. i've tried the usual binary/ascii techniques, but they just seem to loop back in to each other. what is the step by step to get from base64 to text? this is for an evil riddle i'm trying to solve. thanks. Becca. here's the...
8
2800
by: Jeremy Kitchen | last post by:
I have encoded a string into Base64 for the purpose of encryption. I then later decrypted it and converted it back from Base64 the final string returns with four nothing characters. "pass" what the result should be "pass____ what the result is where each underline char is a nothing char. I am about to write a function that will remove the nothing chars butI would like to know what is causing the problem and simply avoid it
10
4045
by: pycraze | last post by:
Hi , I am currently trying to implement base64 encoding and decoding scheme in C . Python has a module , base64 , that will do the encoding and decoding with ease . I am aware of OpenSSL having support for base64 encoding and decoding , but i will have to now implement both in C without using the openssl libraries . I was able to download a code w.r.t. base 64 encoding and decoding . I am attaching the code below .
3
3786
by: d-fan | last post by:
void decodebio( unsigned char *encbuf, unsigned char * decbuf, int destbuf ) { /* Read Base64 encoded data from standard input and write the decoded data to standard output: */ BIO *b64, *bio ; long i ; char buffer ; memset(buffer, 0, 512) ;
3
6837
by: ashu | last post by:
I am searching for Win32 (or WinMobile) API for converting ASCII string to Base64 and vice-versa can anyone help me out.... Thanks in advance...
1
5178
by: Bryan A | last post by:
I'm having a problem decoding an encrypted Base64 string (with a key). I am trying to encode and decode with a url friendly version. It works if I use them seperate but when I try to put them both in the same function it doesn't decrypt it right. function encrypt($string, $key) { $result = ”; for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1);
0
8597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9012
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8880
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4611
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3034
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2319
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1992
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.