base64

How to encode media in base64 given URL in Ruby

I'm trying to upload an image to PingFM. Their documentation says: media – base64 encoded media data. I can access this image via the URL. I tried (practically guessed) this: ActiveSupport::Base64.encode64(open("http://image.com/img.jpg")) But I get this error: TypeError: can't convert Tempfile into String from /usr/lib/ruby/...

How much faster is it to use inline/base64 images for a web site than just linking to the hard file?

How much faster is it to use a base64/line to display images than opposed to simply linking to the hard file on the server? url(data:image/png;base64,.......) I haven't been able to find any type of performance metrics on this. I have a few concerns: You no longer gain the benefit of caching Isn't a base64 A LOT larger in size than...

IE6: How to get inline base64 images to work with IE6?

How do I get IE6 to display inline base64 encoded images? <img src="data:image/png;base64,....." /> This works in Firefox/Chrome/Safari but not IE6. ...

asp.net Invalid character in a Base-64 string

...

How to split a string in PHP [solved]

Hello, I have a long string resulted from encoding a binary file -an image file- (in base 64). Is there a particulary method (or rule) I should follow when spliting it? Edit: I want to write the string to a xml file, but in order to do this I must split it in smaller chunks. Edit2: I would like to split it by length (I think that is more...

Encryption/Encoding Algorithm

I have an unencrypted/unencoded string - "565040574". I also have the encrypted/encoded string for this string - "BSubW2AUWrSCL7dk9ucoiA==". It looks like this string has been Base64ed after encryption, but I don't know which encryption algorithm has been used. If I convert "BSubW2AUWrSCL7dk9ucoiA==" string to bytes using Convert.FromBa...

Do I need to encode using Base 64 in my web service?

I am transferring messages to mobile devices via a web service. The data is an xml string, which I compress using GZipStream, then encode using Base64. I am getting out-of memory exceptions in the emulator and looking to optimise the process so I have stopped passing the string around by value and removed unecessary copies of byte array...

What is the advantage of using base64 encode?

I would like to understand it better. Do I really need it? Can't I simple use pure string? I heard it expand the size of things encoded by 30% (at least for images). ...

XSLT: Convert base64 data into image files

I have seen several questions on how to encode an image file in base64, but how about the other way around - how do I reconstitute a picture from a base64 string stored in an XML file? <resource> <data encoding="base64"> R0lGODlhEAAQAPMAMcDAwP/crv/erbigfVdLOyslHQAAAAECAwECAwECAwECAwECAwECAwECAwEC AwECAyH/C01TT0ZGSUNFOS4wGAAAAAxtc09QTVNP...

Webservice to convert file to base64 string

Is there a webservice available that will take a url of a file e.g. http://example.com/images/image.jpg and return a base64 encoded string of that file preferably in json format? ...

Why need base64 in smtp

Why do I need to encode login and password in base64, when using SMTP-AUTH. Here is an example of my SMTP conversation 220 ALAN.CP.com Microsoft ESMTP MAIL Service ehlo 250 ALAN.CP.com Hello [10.10.1.1] more... verbs 250 OK auth login 334 VXNlcm5hbWU6 <base64 encoded password> 334 UGFzc3dvcmQ6 <base64 encoded password> 235 2.7....

JBoss 5 truncates trailing = of a base64 cookie string

After upgrading from JBoss 4 to JBoss 5, I've noticed the most annoying regression. It truncates the trailing equal sign ('=') of a base64 cookie value. It took me so much time to understand that the problem wasn't my code but JBoss', I googled it and find out it's a known issue . The suggested work around is to calculate the string le...

Search for base64 encoded content in StreamReader?

I need to parse a NDR file from an SMTP badmail folder from IIS. Attached to the NDR is the content which is base64 encoded. That is what I need to get to. I was hoping that, using a StreamReader, it would be all one line, but they are separate lines when a perforam a .ReadLine. Here is a sample of an NDR: From: postmaster To: hidden...

Why does this base64 string comparison in Perl fail?

I am trying to compare an encode_base64('test') to the string variable containing the base64 string of 'test'. The problem is it never validates! use MIMI::Base64 qw(encode_base64); if (encode_base64("test") eq "dGVzdA==") { print "true"; } Am I forgetting anything? ...

base64 encoded data mixed in with "random" hex

I get an input string with some data that's base64 encoded. Unfortunately, it gets random hexadecimal data (all lowercase) mixed it. It's fairly straightforward to sort out by hand because the hexadecimal data all seems to be in segments of 32 bytes. For example, I can format an example string like this: 6dd11d15c419ac219901f14bdd9...

Decoding base64-encoded data from xml document

I receive some xml-files with embedded base64-encoded images, that I need to decode and save as files. An unmodified (other than zipped) example of such a file can be downloaded below: 20091123-125320.zip (60KB) However, I get errors like "Invalid length for a Base-64 char array" and "Invalid character in a Base-64 string". I marked t...

is there a viable way to feature detect support for image:data base64

using something along the lines of: background:url(data:image/gif;base64,R0lGODlhIwAhALMAAAAAADQ0NENDQ25ubouLi6ioqLa2ttPT0/Dw8P///wAAAAAAAAAAAAAAAAAAAAAAACwAAAAAIwAhAAAIpQABCBxIsCCAAAYTKlw4cECCAQwjMnSY4KHEiwQpVrSIUaLGjRw7Kvy4EYEAkSNBljyJ0iDJiiZbulQJk6XMhjQTxLyJk+ZOngBe6rTJU+jPojmTKqXZc6nTpAKFPp0qsMDUqyoHWsWKleBWrk8LfgV5AKjYnGXNakWrdi3Nt...

Can we convert a byte array into an InputStream in Java?

Can we convert a byte array into an InputStream in Java? I have been looking on the internet but couldn't find it. I have a method that has an InputStream as argument. The InputStream cph I have is base64 encoded so I had to decode it using BASE64Decoder decoder = new BASE64Decoder(); byte[] decodedBytes = decoder.decodeBuffer(cph); ...

Java - Base64 string in and out of a text

I need to write string containing base64 encoded text to a text file and then later read that string back from the text file to a string variable. How can i do it so that there is no data loss due to encoding issues? ...

Encode value as base64

I'm trying to write a customization in Lyris ListManager (10.2). The language is TCL, which I know very little about. We need to encode a value as base64 (or really, anything that obfuscates a querystring parameter), but I can't seem to figure out how. Is there a command native to TCL to do this? ...