By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,505 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Possible to write an image to a file?

P: n/a
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.
May 25 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a

no****@invalid.invalid wrote:
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

May 25 '06 #2

P: n/a
no****@invalid.invalid wrote:
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 25 '06 #3

P: n/a
> 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?
May 25 '06 #4

P: n/a

no****@invalid.invalid wrote:
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?


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

May 25 '06 #5

P: n/a
no****@invalid.invalid wrote:
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!.


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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 25 '06 #6

P: n/a
>> 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!.
Oh good. Another newb hunter loose in the woods who isn't sure he's packing
a 30.06 or a squirt gun.
> The link above, wasn't exactly spot on in being helpful

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

Bob Lehmann

<no****@invalid.invalid> wrote in message
news:U5******************************@bt.com... 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?

May 26 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.