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
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in IMAGE
- Golang lambda upload image into s3 static website
- Put an image behind the title in a WP, WooCommerce "shop" page
- How to create an JSOUP element from byte array image (Load from Database)
- Cloudflare not respecting Cache-Control
- Sending multiple images and data in a single angular observable
- Create and combine several images into a single image for my react native App
- Should I compress images in java backend before sending to frontend?
- Javascript Place Image Where User Clicks
- Whitespace in document has a bottom border remnant or some other line at the bottom of the whitespace
- Sony Spresense Camera Board
- After completely installation and done all the work i am getting Permission denied error do any one have solution
- HTML page on NAS server image not showing on mobile phone
- mouse coordinates in image go below 0 and above width
- Why are the css images or js not loading in my laravel project?
- Python pillow library text align center
Related Questions in ASP-CLASSIC
- How can I execute logic code on ASP Classic Server side by using Jquery ajax?
- Migrating an ASP application between services shows ODBC Driver error: data source name not found
- Varchar(max) causing other other accesses of the record set to return null
- ASP Classic / JS multi select filter
- Missing VBScript.Encrypt on Windows Server 2019
- How to identify a user's location
- ASP Fix/Int functions not behaving as expected
- ASP Classic 3rd Party DLL Registration
- How To Capture Form Data using OnChange
- Stream response in a file
- iis 8.5, how to set visitor permission only on current site?
- How do you replace the last comma with "and" in a comma-separated string?
- CRUD operation not work with ADODB and SQL server using MSOLEDBSQL19 Provider and "strict" option (TLS1.3)
- Using a specific User/Domain in a Msxml2.ServerXMLHTTP request in classic ASP
- JavaScript won't execute when calling webpage via VBScript using XMLHttpRequest
Related Questions in ENCODER
- Android mediacodec avc/h264 encoder always produces 1MB output buffer size
- Spark Encoders.bean not working for generic class
- how do i implement a model in my streamlit application
- Android media codec: Mismatch between encoder and decoder buffer sizes
- .init is not a function using opus-recorder
- How can I define this RSC code using poly2trellis in matlab (or python)?
- train row encoder and column encoder in Tensorflow
- Annotated Transformer - Why x + DropOut(Sublayer(LayerNorm(x)))?
- How to save model after adding attention mechanism?
- Servo Controller Fail State
- ColumnTransformer output columns order
- Getting "ValueError: X has 6 features, but LinearRegression is expecting 7 features as input." probably due to ColumnTransformation (Pipeline) step
- How to save the Encoder and Decoder and Autoencoder separately in 3 files after the training?
- Implementing Kalman Filter for Improved Measurement Accuracy in Autonomous Two-Wheeled Robot with Encoders
- Why Is Inverse Quantization and Inverse Transform Taken Before Motion Estimation in H.264?
Related Questions in DECODER
- Parlance's CTC prefix Beam search decoding logic insights
- PNG decode data from IDAT chunk
- Android media codec: Mismatch between encoder and decoder buffer sizes
- How to save model after adding attention mechanism?
- How do I use a std::map to change a vector of strings into another vector of characters?
- How to confirm that whether decoder support HLG or HDR format in Android?
- Strange names in Javascript code - how do I decode it?
- How to find frame length of stereo mp3
- Splitting Pytorch transformer into encoder & decoder
- How to hardware decode a Stream from an RTSP source
- How to solve "Error: Type 'DecoderCallback' not found." to run a Flutter app locally on an iPhone?
- How to decode and fmp4 + chunked live stream
- GStreamer Pipeline: Decoding H.264 from Appsrc to Appsink
- How to decode .twb file
- How to set the Microsoft WMF VP9 decoder to decode VP9 videos
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 # Hahtags
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