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 | |
|---|---|---|---|---|---|
|
BNDES anuncia empréstimos para mercado editorial investir no e-book
|
Notícias |
Notícias
|
|
|
|
BBC lança player de vídeo para distribuir conteúdos na internet
|
Notícias |
Notícias
|
|
|
|
Documentação para sites
alguem tem um exemplo? |
DESIGN em GERAL |
labp
|
|
|
|
Software permite que grafiteiros com paralisia desenhem com os olhos
|
Notícias |
Notícias
|
|
|
|
AOL vende programa de mensagem ICQ para empresa russa
|
Notícias |
Notícias
|
|
|
|
Despertador cofre só pára de tocar com dinheiro
|
Notícias |
Notícias
|
|
|
|
Marcas na web devem agir rápido para evitar crise
|
Notícias |
Notícias
|
|
|
|
Modelo da Apple foi "criado para durar", avalia JPMorgan
|
Notícias |
Notícias
|
|
Publicidade
|
|

Help













