473,386 Members | 1,924 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,386 software developers and data experts.

Responding with images and pdf files

I'm creating a web service using ASP.net that needs to respond with pdf files
or images to HTTP-GET requests. I've searched extensively and not found any
documentation or examples.

What I'm expecting is to be able to set the content type to application/pdf,
or image/jpg (etc) and then just stream the content over to the client.

Thanks for you help.
Nov 21 '05 #1
3 1228
Hi!

If you can fix the Objects themselves.. the Image or the PDF or whatever you
can always Serilize them and send over as a astring.. and then deserialize.
I guess!

You can serilalize any objects in .NET

/Lars
"Gardar" <Ga****@discussions.microsoft.com> skrev i meddelandet
news:E7**********************************@microsof t.com...
I'm creating a web service using ASP.net that needs to respond with pdf files or images to HTTP-GET requests. I've searched extensively and not found any documentation or examples.

What I'm expecting is to be able to set the content type to application/pdf, or image/jpg (etc) and then just stream the content over to the client.

Thanks for you help.

Nov 21 '05 #2
Takk for svaret Lars:

Yes, I could, however then the response would not be application/pdf.

The client in this case is just a web-browser, since the bindings are just
HTTP-GET, the browser is receiving data it can render directly --- pdf,
images and style-ized XML

"Lars Netzel" wrote:
Hi!

If you can fix the Objects themselves.. the Image or the PDF or whatever you
can always Serilize them and send over as a astring.. and then deserialize.
I guess!

You can serilalize any objects in .NET

/Lars
"Gardar" <Ga****@discussions.microsoft.com> skrev i meddelandet
news:E7**********************************@microsof t.com...
I'm creating a web service using ASP.net that needs to respond with pdf

files
or images to HTTP-GET requests. I've searched extensively and not found

any
documentation or examples.

What I'm expecting is to be able to set the content type to

application/pdf,
or image/jpg (etc) and then just stream the content over to the client.

Thanks for you help.


Nov 21 '05 #3
Solution is simple --- Once you know it

Use the "Context::Response" object to write out the file and application
type...

Thanks,

"Gardar" wrote:
Takk for svaret Lars:

Yes, I could, however then the response would not be application/pdf.

The client in this case is just a web-browser, since the bindings are just
HTTP-GET, the browser is receiving data it can render directly --- pdf,
images and style-ized XML

"Lars Netzel" wrote:
Hi!

If you can fix the Objects themselves.. the Image or the PDF or whatever you
can always Serilize them and send over as a astring.. and then deserialize.
I guess!

You can serilalize any objects in .NET

/Lars
"Gardar" <Ga****@discussions.microsoft.com> skrev i meddelandet
news:E7**********************************@microsof t.com...
I'm creating a web service using ASP.net that needs to respond with pdf

files
or images to HTTP-GET requests. I've searched extensively and not found

any
documentation or examples.

What I'm expecting is to be able to set the content type to

application/pdf,
or image/jpg (etc) and then just stream the content over to the client.

Thanks for you help.


Nov 23 '05 #4

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

Similar topics

198
by: Michael N. Christoff | last post by:
Java, the software developed by Sun Microsystems in the mid-1990s as a universal operating system for Internet applications, gave NASA a low-cost and easy-to-use option for running Spirit, the...
13
by: long5120 | last post by:
I am trying to use webpage with javascript to check if a web server is responding. I was thinking of using 2 frames. Frame1 will have the site, and the Frame2 will be a status bar (not really...
7
by: Vinay | last post by:
Hi All: I have a small application that stores images either in the database or as files (depending on the user preference). I'm in the process of providing a web interface to this application....
3
by: Arun | last post by:
Hi, I have simple question to ask. How to write multiple Binary files to the Browser using Asp.Net and Visual C#.net I have seen examples where single binary file is written to browser. ...
9
by: Adam J Knight | last post by:
Hi all, Just wondering whats everyones prefered method of storing images ? 1) File System 2) Database (SqlServer) (Seems to be easier, but has a performance hit) Appreciate some insight!!!...
1
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
2
by: wstsoi | last post by:
hi I have to read images from spreadsheet, is it possible to do with php?
2
by: mindrage00 | last post by:
Hi! I am creating an image gallary where the images are numbered 1, 2, 3 etc. Users will be uploading the images so if i need to delete an image, I need the code to be able to check if that number...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.