P
Paul Rogers
Hi, im wanting to outpout a binary file from ASP, but encrypt it on the fly
according to a given seed (retrieved according to the users login).
But ive fallen at the first hurdle, and cant even seem to get access to the
raw bytes of the file as I pass it through. The code I have written is thus:
----------------
objStream.LoadFromFile( "D:\\" + filename );
//Output the contents of the stream object
Response.ContentType = "application/none";
Response.AddHeader( "Content-disposition", "inline; filename="+filename );
Response.AddHeader( "Content-Length", objStream.Size );
// reset the stream back to 0
var index;
objStream.Position = 0;
while (objStream.Position < objStream.Size)
{
var testbyte;
var ibound;
testbytes = objStream.Read(1000);
ibound = 0;
Response.Write(testbyte);
while (ibound < ubound(testbyte))
{
Response.WriteBinary(testbyte(ibound));
ibound = ibound + 1;
}
}
----------------
This code isnt supposed to do anything other than pass the bytes back (in a
convulted way) which i will later turn into encryption. But I can access the
raw bytes using testbyte(ibound) it seems. Will someone please enlighten me,
Ive spent all night fighting HTTP 500 errors
Thanks
Paul
according to a given seed (retrieved according to the users login).
But ive fallen at the first hurdle, and cant even seem to get access to the
raw bytes of the file as I pass it through. The code I have written is thus:
----------------
objStream.LoadFromFile( "D:\\" + filename );
//Output the contents of the stream object
Response.ContentType = "application/none";
Response.AddHeader( "Content-disposition", "inline; filename="+filename );
Response.AddHeader( "Content-Length", objStream.Size );
// reset the stream back to 0
var index;
objStream.Position = 0;
while (objStream.Position < objStream.Size)
{
var testbyte;
var ibound;
testbytes = objStream.Read(1000);
ibound = 0;
Response.Write(testbyte);
while (ibound < ubound(testbyte))
{
Response.WriteBinary(testbyte(ibound));
ibound = ibound + 1;
}
}
----------------
This code isnt supposed to do anything other than pass the bytes back (in a
convulted way) which i will later turn into encryption. But I can access the
raw bytes using testbyte(ibound) it seems. Will someone please enlighten me,
Ive spent all night fighting HTTP 500 errors
Thanks
Paul