I am trying to output a PDF using javascript (ASP) on the server side. The current method I'm using is:
xfile=Server.MapPath(lib.fso.GetTempName())
xf=lib.fopen(xfile,"wb");
lib.fwrite(xf,this.buffer);
lib.fclose(xf);
outB = Server.CreateObject("ADODB.Stream")
outB.Type = 1
outB.Open()
outB.LoadFromFile (xfile)
Response.BinaryWrite(outB.Read())
outB.Close()
lib.fso.DeleteFile(xfile);
This works, but requires write access on the server. Is there a way to do the same without writing to a file?
I was not able to figure out how to convert the string this.bufferto array of bytewhich I can write with Response.BinaryWritewithout writing the file first.
alumb source
share