Ted k’ É assim que tem que ser! Programando em ASP, ASP.NET, PHP, CSS, dentre outras…


19
Jun/09
0


Forçando Downloads com ASP

public function download(arquivo, pasta)
    dim objStream
    set objStream = server.createObject("ADODB.Stream")
    with (response)
        .buffer = true
        .addHeader "Content-Type","application/x-msdownload"
        .addHeader "Content-Disposition","attachment; filename="&arquivo
        .flush
    end with
    with (objStream)
        .open
        .type = 1
        .loadFromFile server.mapPath(pasta)
    end with
    response.binaryWrite objStream.read
    set objStream = nothing
    response.flush
end function

Página 1 de 11



Portfólio Ted k'

Atualize seu Navegador