Ask a Question related to ASP.NET General, Design and Development.
-
michal januszczyk #1
return binary content from within ASPX page
my aspx page gets binary data with ms-word file. (just
byte[] array). I want this data to send back to the
browser, but when i try to do this with the following
method:
byte[] binaryData =....
Response.BinaryWrite(binaryData);
the binary data is appended with some html header .
Obviously winword does not recognize the file format.
The question is:
How to reply the browser in a way, that it would
recognize the file format and open the file ?
Thanx for any suggestions
Michal Januszczyk
michal januszczyk Guest
-
What is the fastest way to return the binary of a file?
Currently this is what I'm doing and it takes about 30 - 60 seconds for 88 kb file to show in my web browser from my web service. I think that is... -
How can I return a binary file (image) from a web service
A url to an image file will be passed to my web service. What function can I use that will get the image and return the image in binary form? ... -
Accessing a aspx page using HttpWebRequest from another aspx page on the same webapp
Did you have any luck on this as I have the same problem. Maybe you can help me out of you solved your problem. -
encrypt .aspx file content
Hi there Is it possible, as an added (fairly paranoid) security measure, to encrypt the content of, say, an .aspx file on the server? Best... -
Return Codes From MessageBox in .ASPX ?
Greetings. I've created a simple ASPX form that displays a record from a SQL Server table. I have a "Delete" button on the form. When the user... -
Steve C. Orr, MCSD #2
Re: return binary content from within ASPX page
You're missing a few vital lines of code:
Response.ContentType = "application/ms-word";
Response.AddHeader("Content-Disposition", "inline;filename=test.doc");
Response.OutputStream.Write(binaryData);
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"michal januszczyk" <michal_januszczyk@hotmail.com> wrote in message
news:02b701c34c42$755b0e00$a001280a@phx.gbl...> my aspx page gets binary data with ms-word file. (just
> byte[] array). I want this data to send back to the
> browser, but when i try to do this with the following
> method:
> byte[] binaryData =....
> Response.BinaryWrite(binaryData);
>
> the binary data is appended with some html header .
> Obviously winword does not recognize the file format.
>
> The question is:
> How to reply the browser in a way, that it would
> recognize the file format and open the file ?
>
> Thanx for any suggestions
> Michal Januszczyk
Steve C. Orr, MCSD Guest
-
Louis Dascoulias #3
Re: return binary content from within ASPX page
Michal,
In a javascript function: window.open(.....).. Look it up to see the params.
Louis Dascoulias, AWS
"Michal Januszczyk" <michal_januszczyk@hotmail.com> wrote in message
news:06d101c34c45$923afe60$a601280a@phx.gbl...>> >-----Original Message-----
> >You're missing a few vital lines of code:
> >
> >Response.ContentType = "application/ms-word";
> >Response.AddHeader("Content-
> >Disposition", "inline;filename=test.doc");
> >Response.OutputStream.Write(binaryData);
> Thanx !
> I still have another tiny problem I can't handle:
> I would like the returned content to be opened in new
> window. Is it somehow possible to specify this on aspx
> page ?
>
Louis Dascoulias Guest



Reply With Quote

