Created
October 1, 2010 01:59
-
-
Save kageroh/605614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<job> | |
<object id="dom" progid="Microsoft.XMLDOM"/> | |
<object id="ado" progid="ADODB.Stream"/> | |
<reference object="ADODB.Stream"/> | |
<script language="VBScript"><![CDATA[ | |
Function input_box(ByVal str) | |
InputBox "", "", str | |
End Function | |
]]></script> | |
<script language="JScript"><![CDATA[ | |
(function() { | |
var path = WSH.arguments(0); | |
var extension = (/\.([^\.]+)$/.exec(path) || [])[1]; | |
ado.open(); | |
ado.type = adTypeBinary; | |
ado.loadFromFile(path); | |
var binary = ado.read(); | |
ado.close(); | |
var element = dom.createElement('tmp'); | |
element.dataType = 'bin.base64'; | |
element.nodeTypedValue = binary; | |
input_box([ | |
'data:', | |
'image/', extension, ';', | |
'base64,', | |
element.text.replace(/\n|\r\n?/g, '') | |
].join('')); | |
})(); | |
]]></script> | |
</job> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment