Possible to write an image to a file?

G

Guest

Using the HttpRequest object to gather material (potentially from an
external server), is it possible to write the response stream into which
ever file type is required e.g. I request not just text, but an image - is
is possible to write the image to file? Or is this just not possible? I can
only find reference to create a text file.

Thanks.
 
B

Baconbutty

Using the HttpRequest object to gather material (potentially from an
external server), is it possible to write the response stream into which
ever file type is required e.g. I request not just text, but an image - is
is possible to write the image to file? Or is this just not possible? I can
only find reference to create a text file.

Thanks.

This is a useful link.

<URL:http://www.motobit.com/tips/detpg_read-write-binary-files/>

Regards

Julian Turner
 
B

Bob Barrows [MVP]

Using the HttpRequest object
I think baconbutty provided your answer so I will concentrate on:

There was no way for you to know it (except maybe by browsing through
some
of the previous questions before posting yours - always a recommended
practice), but this is a classic asp newsgroup.
ASP.Net is a different technology from classic ASP.
While you may be lucky enough to find a dotnet-savvy person here who
can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I
suggest
microsoft.public.dotnet.framework.aspnet.

HTH,
Bob Barrows
 
G

Guest

I think baconbutty provided your answer so I will concentrate on:
There was no way for you to know it (except maybe by browsing through
some
of the previous questions before posting yours - always a recommended
practice), but this is a classic asp newsgroup.

Hehe, well Bob, I wasn't even remotely aware that it was an ASP.NET
question. And to be honest, I'm a newbie in ASP and don't even know what the
difference is yet!.

The link above, wasn't exactly spot on in being helpful - have been
following links and ideas, but to no avail as yet. I just thought they'd be
an alternative method to output an image file rather than using
CreateTextFile. But perhaps, as there's no straightforward answer as yet,
there's no simple answer to my question?
 
B

Baconbutty

Hehe, well Bob, I wasn't even remotely aware that it was an ASP.NET
question. And to be honest, I'm a newbie in ASP and don't even know what the
difference is yet!.

The link above, wasn't exactly spot on in being helpful - have been
following links and ideas, but to no avail as yet. I just thought they'd be
an alternative method to output an image file rather than using
CreateTextFile. But perhaps, as there's no straightforward answer as yet,
there's no simple answer to my question?

I am an amateur at this, but AFAIK, there is no simple answer.

I have sucessfully used the information on the link provided (and
connected links referenced in it) to save binary both on the server and
the client (with client security permission of course) using VBScript.

Whether you are using basic ASP on the server, or you are seeking to
save the file client side using a responseStream from an
XMLHttpRequest, you must use either ADODB.Stream,
Scripting.FileSystemObject, XPCOM (Firefox) or some other component,
subject to any relevant security restrictions. As noted, VBScript and
JavaScript do not provide binary file handling natively.

I have no experience with ASP.NET, but I believe that it uses the
Microsoft .NET Framework, which provides a large library of components.
I would imagine that this would include binary file handling on the
server. Client side, I think you are still stuck with one of the
options above, and client side security restrictions.

Regards

Julian Turner
 
B

Bob Barrows [MVP]

Hehe, well Bob, I wasn't even remotely aware that it was an ASP.NET
question. And to be honest, I'm a newbie in ASP and don't even know
what the difference is yet!.

If your pages have .asp for their extension, then it's classic asp.

If they have .aspx, or .ascx, or .asmx (see the commonality?), then it's
ASP.Net.

I assumed that since you said "HTTPRequest", which is an object in the
..Net framework, that you were using .Net. However, if you meant to say
"XMLHTTPRequest", as baconbutty assumed, then it could be classic ASP,
since that is an object in the MSXML Parser which is often used in
pre-.Net applications.

Bob Barrows
 
B

Bob Lehmann

Hehe, well Bob, I wasn't even remotely aware that it was an ASP.NET
Oh good. Another newb hunter loose in the woods who isn't sure he's packing
a 30.06 or a squirt gun.

It should have been. Or is it because you have no idea what technology
you're even working in?

Bob Lehmann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top