Public Function imgBinary(path)
If (inStr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") = 0) Then
Dim str : Set str = Server.CreateObject("ADODB.Stream")
Dim bin
If (inStr(path,"://") = 0) Then
str.type = 1
str.open()
str.loadFromFile(Server.MapPath(path))
bin = str.read()
Else
dim srv : set srv = Server.CreateObject("Msxml2.ServerXMLHTTP")
srv.Open "GET", path, false
srv.Send()
str.Type = 1
str.Open
bin = srv.responseBody
Set srv = Nothing
End If
Dim open : Set open = Server.CreateObject("MSXML2.DOMDocument.6.0")
Dim src : Set src = open.CreateElement("data")
src.dataType = "bin.base64"
src.nodeTypedValue = bin
path = "data:image/jpg;base64," & src.text
str.Close()
Set str = Nothing
Set src = Nothing
Set open = Nothing
End If
imgBinary = path
End Function
Publicidade
|
|
Page 1 of 1
Base64 Encoding para Imagens
#1
Posted 29 September 2011 - 07:15 PM
Share this topic:
Page 1 of 1
Similar Topics
| Topic | Forum | Started By | Stats | Last Post Info | |
|---|---|---|---|---|---|
|
Problema Flash e Firefox: Imagens Externas
Firefox não carrega imagens em um swf externo com imagens externas |
Flash & ActionScript |
Karian
|
|
|
|
Warner e YouTube confirmam acordo para videoclipes
|
Notícias |
Notícias
|
|
|
|
Sony negocia parceria para produção de TVs Oled
|
Notícias |
Notícias
|
|
|
|
Separar palavra
|
Corel Draw |
bruno_dam
|
|
|
|
WWF lança game em Flash para incentivar redução de desperdício
|
Notícias |
Notícias
|
|
|
|
Veja sugestões de notebooks para games
|
Notícias |
Notícias
|
|
|
|
Imagens não aparem
como fazer as imagens paracerem |
Dreamweaver |
Ciro
|
|
|
|
Confira cuidados para fazer compras natalinas pela internet
|
Notícias |
Notícias
|
|
Publicidade
|
|

Help













