I need to convert uploaded binary files to base64 string format on the fly. I\'m using ASP, Vbscript. Using Midori\'s component for base64 conversion. For small size files (
This is what worked for me
Function Base64DataURI(url)
'Create an Http object, use any of the four objects
Dim Http
Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
'Send request To URL
Http.Open "GET", url, False
Http.Send
'Get response data As a string and encode as base64
Base64DataURI = Encrypt(Http.ResponseText)
End Function
In my case the URL is a script that generates a barcode on the fly and needed to encode to include that in emails.
Encrypt is a pretty standard function we use to encode as Base64, but the main concept we needed was to get the file via URL not file system.