473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Streaming PDF to browser

Hello,

I am looking for the best way to securely stream a PDF to the browser (IE).
The PDF would be inside our firewall, so presumably there would have to be
some sort of middle-tier app inside the firewall that would receive a
request from a browser and then get the PDF and stream it outside the
firewall to the browser.

Does that make sense?

Thanks,
Douglas
May 2 '07 #1
7 9887
You could create a special page (or HTTPHandler) to dish out the files.
It would probably use the Response.WriteFile method to retrieve the
specified file and output it.

Here's more info:
http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Douglas McCormick" <dm********@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hello,

I am looking for the best way to securely stream a PDF to the browser
(IE). The PDF would be inside our firewall, so presumably there would have
to be some sort of middle-tier app inside the firewall that would receive
a request from a browser and then get the PDF and stream it outside the
firewall to the browser.

Does that make sense?

Thanks,
Douglas

May 2 '07 #2
Steve,

Thanks for the reply. However, that sounds like the browser would need
access to the file structure. In my case, the actual PDF is inside the
firewall, so the browser does not have access. I also cannot copy the PDF
outside of the firewall and put on the web server because it is not secure.
Someone could hack the web server and get access to the PDF. It has to be
secure.

Thanks,
Douglas

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:66**********************************@microsof t.com...
You could create a special page (or HTTPHandler) to dish out the files.
It would probably use the Response.WriteFile method to retrieve the
specified file and output it.

Here's more info:
http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Douglas McCormick" <dm********@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hello,

I am looking for the best way to securely stream a PDF to the browser
(IE). The PDF would be inside our firewall, so presumably there would
have to be some sort of middle-tier app inside the firewall that would
receive a request from a browser and then get the PDF and stream it
outside the firewall to the browser.

Does that make sense?

Thanks,
Douglas


May 3 '07 #3
Hi Douglas,

If you do not want to make your ASP.NET application access the actual file
directly, you expose those PDF file stream through an intermediate service.
You this service can access the original raw PDF file or data storage and
pass it to your ASP.NET web application through some distrubute service
communciation( such as webservice, remoting .....).

In your ASP.NET page (or custom http handler), you simply communicate to
the intermediate service to get the binary content of the file stream and
write it out to the response stream. e.g.

============
private void Page_Load(object sender, System.EventArgs e)
{
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "Application/pdf";
byte[] filebytes = //get binary content through
intermediate component/service

Response.BinaryWrite(filebytes);
Response.End();
}

=====================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 3 '07 #4
Steve,
>
Thanks for the reply. However, that sounds like the browser would need
access to the file structure. In my case, the actual PDF is inside the
firewall, so the browser does not have access. I also cannot copy the
PDF outside of the firewall and put on the web server because it is
not secure. Someone could hack the web server and get access to the
PDF. It has to be secure.
The browser does not need to access that PDF file directly. Response.WriteFile
retrieves the file server side and send the bytes of that file to the browser.
So it's your webserver that is doing the reading.
Now you still need to figure out how that webserver can get access to
that pdf file :-(.

Hans Kesting

Thanks,
Douglas
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:66**********************************@microsof t.com...
>You could create a special page (or HTTPHandler) to dish out the
files. It would probably use the Response.WriteFile method to
retrieve the specified file and output it.

Here's more info:
http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Douglas McCormick" <dm********@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>Hello,

I am looking for the best way to securely stream a PDF to the
browser (IE). The PDF would be inside our firewall, so presumably
there would have to be some sort of middle-tier app inside the
firewall that would receive a request from a browser and then get
the PDF and stream it outside the firewall to the browser.

Does that make sense?

Thanks,
Douglas

May 3 '07 #5
I will look into that. Thanks!

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:zI**************@TK2MSFTNGHUB02.phx.gbl...
Hi Douglas,

If you do not want to make your ASP.NET application access the actual file
directly, you expose those PDF file stream through an intermediate
service.
You this service can access the original raw PDF file or data storage and
pass it to your ASP.NET web application through some distrubute service
communciation( such as webservice, remoting .....).

In your ASP.NET page (or custom http handler), you simply communicate to
the intermediate service to get the binary content of the file stream and
write it out to the response stream. e.g.

============
private void Page_Load(object sender, System.EventArgs e)
{
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "Application/pdf";
byte[] filebytes = //get binary content through
intermediate component/service

Response.BinaryWrite(filebytes);
Response.End();
}

=====================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

May 3 '07 #6
You can also look for some reference and information about programmatically
generate binary output in web page over the internet. If there is anything
else you wonder, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

May 4 '07 #7
They would not need access to the file structure - the file would be
streamed to the browser through the firewall via FTP.

Take a look at the second link that Steve replied - the exact clode that you
need is included there in the "Download" section.
"Douglas McCormick" <dm********@nospam.nospamwrote in message
news:eA**************@TK2MSFTNGP06.phx.gbl...
Steve,

Thanks for the reply. However, that sounds like the browser would need
access to the file structure. In my case, the actual PDF is inside the
firewall, so the browser does not have access. I also cannot copy the PDF
outside of the firewall and put on the web server because it is not
secure. Someone could hack the web server and get access to the PDF. It
has to be secure.

Thanks,
Douglas

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:66**********************************@microsof t.com...
>You could create a special page (or HTTPHandler) to dish out the files.
It would probably use the Response.WriteFile method to retrieve the
specified file and output it.

Here's more info:
http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx
http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Douglas McCormick" <dm********@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>Hello,

I am looking for the best way to securely stream a PDF to the browser
(IE). The PDF would be inside our firewall, so presumably there would
have to be some sort of middle-tier app inside the firewall that would
receive a request from a browser and then get the PDF and stream it
outside the firewall to the browser.

Does that make sense?

Thanks,
Douglas



May 4 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Markus Ernst | last post by:
Hi I know this question is rather HTTP related than PHP, but I did not find an HTTP group on my news server. I deliver some files with the following PHP syntax: header('Content-Description:...
22
by: googlegroups | last post by:
I am playing with the XMLHTTPRequest method to perform client/server transactions. I have it set up right now so that when readyState is 4, it takes the XML and processes it. This works great until...
3
by: Rob | last post by:
I have an ASP.Net web app that generates a Crystal Report in PDF format. Since there is sensitive data within the reports, the pdfs need to be streamed to the browser then deleted immediately. The...
5
by: John | last post by:
Hi all, I have an (well, what I think to be, at least) interesting question: Is it possible to stream data down to the client and, after a certain amount of data has been streamed, allow the...
3
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file...
6
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios,...
1
by: DB | last post by:
Hi All, I’m trying to stream a PDF with .NET 2.0 in a c# web app. However, it does not actually show the PDF (using adobe acrobat). The Situation: Click on a Button, Opens a new Window,...
4
by: Gary Brown | last post by:
Hi, I need a web browser capable of handling video streams and that will stay in front of the Z order. There are a number of video streaming sources I watch that launch a browser window...
2
by: SPG | last post by:
Hi, Two questions for you all.. Firstly, is there a way of streaming video using PHP? At the moment I just have a link to a video file and the whole thing downloads before playing which is a...
3
by: Brad | last post by:
I have an aspx page that is sending pdf files to client browsers: it uses a filestream to read the pdf file and response.binarywrite to send content to the browser. This has worked great for years...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.