Can any one tell me how to decode a base64 encoded image in classic ASP? The image is encoded by Java org.apache base64 class. The Java uses RFC 2045 for base64 decoding.
base64 image decoder for ASP classic
4.8k Views Asked by agarwal_achhnera At
2
There are 2 best solutions below
1
cuixiping
On
<%
Set objXML = Server.CreateObject("MSXml2.DOMDocument")
Set objDocElem = objXML.createElement("Base64Data")
objDocElem.DataType = "bin.base64"
objDocElem.text = "/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAUD" 'encodedString
'Save to disk
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write objDocElem.NodeTypedValue
objStream.SaveToFile "abc.jpg", 2
set objStream = Nothing
'Or send to browser
Response.ContentType = "image/jpeg"
Response.AddHeader "Content-Disposition", "attachment; filename=abc.jpg";
Response.BinaryWrite objDocElem.NodeTypedValue
Set objXML = Nothing
Set objDocElem = Nothing
%>
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in IMAGE
- Add image to JCheckBoxMenuItem
- Display images on Django Template Site
- How to resize images with PHP PARSE SDK
- Animation in Java on top of JPanel
- Slow performance on ipad erasing image
- What are the pros and cons of the picture element?
- Carrierwave file upload with different file types
- How to use annotorious with angular
- Images not showing when uploaded to server
- ImageView doesn't show up
- Image Resizing adjusts ratio
- Displaying bitmap image on Android (OpenCV)
- Class 'Imagick' not found - PHP and Windows
- Image position - randomly select position
- Replace image 1 with image 2 after 5 sec
Related Questions in ASP-CLASSIC
- How to implement Google Recaptcha 2.0 in ASP Classic?
- microsoft odbc driver manager data source name not found and no default driver specified
- .asp file replaced on production but the codes changes are not reflecting
- How do I take values entered on one html page's form, and enter them on another html page as variables
- Microsoft.XMLDOM - Facebook Page RSS - System error: -2147012866
- ASP include file after ajax post
- "+" symbol contain email file name is not opening
- Error when leaving input blank in ASP
- How do I reload an ASP page with a new querystring?
- LIKE operator in SQL for my Access Database returns no values in ASP CLASSIC while it does if the query gets copied directly in Access
- Read POSTed Binary File And Write To a New Binary File
- Deploying a classic ASP site from IIS 6 (2003 WS) to IIS 7 (WS 2008). Tried Manual deploy and msdeploy
- ASP Error 0223 - TypeLib Not Found, intermittent, resolved after IIS restart
- Looping through JSON using ASPJSON
- Javascript Ajax Call always returns readyState=1 and status=0 error
Related Questions in ENCODER
- ZXingObjC encoding issues
- how to write our own program in JM reference software
- Will all phones support YUV 420 (Semi) Planar color format in h.264 encoder?
- ASN1 Structure Encoding
- rotary encoder glitch in arduino
- is the audio source for .yuv test video sequences available?
- JPEG image file creation to be recognized by OS
- Record and playback with Opus Codec in Android
- Unable to decode utf-8 using thai language?
- Live streaming from remote machine webcam to wowza media server using encoder
- Encoding passwords using sha512 doesn't work correctly in Symfony2
- MediaCodec H264 Encoder not working on Snapdragon 800 devices
- Writing .mp3 file directly from stream
- Using jcodec SequenceEncoder
- How do I implement the android gif encoder in my app?
Related Questions in DECODER
- ASN1 Structure Encoding
- Android decoder dequeueOutputBuffer returns -1
- How to convert cable TV channel into Ip based stream
- Decoding a url-encoded windows-1251 (cp1251) string with JavaScript
- ZXing Decoder Online - Submit Error
- decoder JPEG not available (using virtualenv)
- Record and playback with Opus Codec in Android
- Unable to decode utf-8 using thai language?
- Tuning language weight (LW) and word insertion penalties (WIP) in CMU SPHINX
- FFMPEG: Explain parameters of any codecs function pointers
- Marc21 Binary Decoder with Akka-Stream
- Decoding H.264 NALU Stream C#
- Caesar Cipher decoded wrongly in Java
- image decoding in asp
- base64 image decoder for ASP classic
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use the Capicom COM object. I've been using it to to the reverse (base64 encoding). This is what I would do (if you've got a big loop, you'd better have the CreateObject done outside the loop, but in simple cases this should do it):
Reference : http://msdn.microsoft.com/en-us/library/aa388176(v=vs.85).aspx
By the way, capicom.dll can be downloaded from MS site : http://www.microsoft.com/downloads/en/details.aspx?FamilyID=860ee43a-a843-462f-abb5-ff88ea5896f6