Writing image data to web page without additional ASPX file

N

Neo Geshel

About 4 months ago I came across this one web page that talked about
streaming raw image data (from a database, for example) directly to a
web page without requiring a secondary ASPX page to output the data as
an image.

I cannot remember if it talked about having the raw data inline with the
HTML page, or having it bound to a server control. Does anyone know the
article that I am talking about?

TIA
...Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
“Anyone who believes in Intelligent Design (“creationismâ€) is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms.†- 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.†Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 
B

Bruce Barker

html 4.0 compliant browsers (firefox, safari,opera, etc), but not IE
obviously, support inline encoding of an image.

<img src="data:image/gif;base64,<image encoded in base64>">

-- bruce (sqlwork.com)



About 4 months ago I came across this one web page that talked about
streaming raw image data (from a database, for example) directly to a
web page without requiring a secondary ASPX page to output the data as
an image.

I cannot remember if it talked about having the raw data inline with the
HTML page, or having it bound to a server control. Does anyone know the
article that I am talking about?

TIA
....Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
"Anyone who believes in Intelligent Design ("creationism") is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms." - 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that "A nymphomaniac is a woman [who is] as
obsessed with sex as the average man." Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 
N

Neo Geshel

Bruce said:
html 4.0 compliant browsers (firefox, safari,opera, etc), but not IE
obviously, support inline encoding of an image.

<img src="data:image/gif;base64,<image encoded in base64>">

-- bruce (sqlwork.com)

Okay, second silly question: how do I make the <input type="file"
runat="server" /> HTML control maintain viewstate?

What I am trying to do is create a very simple news post form with a
preview. A title, date, and main body (comment) is entered, with an
optional image. When I go to preview a post, it is a simple matter to
unhide a placeholder that contains literals that can be filled, so a
"preview" can be constructed. Since this is an admin interface, I can
easily restrict the browser type to Mozilla/Opera, and make use of your
method above by calling the raw content of the file being uploaded.
However, the original file upload input field becomes blank again,
preventing a file upload after a preview.

What I would like to do is be able to either maintain viewstate for the
file input field, or get the complete drive path of the file on the
client's computer (C:\filesystem\image.jpg) and use that as the image
URL as well as repopulating the file input field with it. Since this is
an admin site, and since this is a preview of the post, using the
client's drive path for the image would work beautifully prior to the
image actually being uploaded.

Any suggestions?
...Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
“Anyone who believes in Intelligent Design (“creationismâ€) is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms.†- 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.†Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 
N

Neo Geshel

Peter said:
Neo,
Here is one implementation that I did some time ago, for starters:

http://www.eggheadcafe.com/articles/20050911.asp

Peter

An excellent choice for the front-end site, but a little too heavy for
the quick-and-dirty admin section that I’m now working on...

Thanks, tho! I’ll take a look over it once I get the admin section done,
as displaying images is a bit of a kludge on the main site.

...Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
“Anyone who believes in Intelligent Design (“creationismâ€) is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms.†- 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.†Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 
G

Guest

The filename in the File Upload control is not retained between postbacks.
This is a security feature that cannot be altered.
It may be possible to get around this with client side code, but I'm not
sure I'd recommend that since you'd be overriding carefully thought out
security precautions.

--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net


--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net



Neo Geshel said:
Bruce said:
html 4.0 compliant browsers (firefox, safari,opera, etc), but not IE
obviously, support inline encoding of an image.

<img src="data:image/gif;base64,<image encoded in base64>">

-- bruce (sqlwork.com)

Okay, second silly question: how do I make the <input type="file"
runat="server" /> HTML control maintain viewstate?

What I am trying to do is create a very simple news post form with a
preview. A title, date, and main body (comment) is entered, with an
optional image. When I go to preview a post, it is a simple matter to
unhide a placeholder that contains literals that can be filled, so a
"preview" can be constructed. Since this is an admin interface, I can
easily restrict the browser type to Mozilla/Opera, and make use of your
method above by calling the raw content of the file being uploaded.
However, the original file upload input field becomes blank again,
preventing a file upload after a preview.

What I would like to do is be able to either maintain viewstate for the
file input field, or get the complete drive path of the file on the
client's computer (C:\filesystem\image.jpg) and use that as the image
URL as well as repopulating the file input field with it. Since this is
an admin site, and since this is a preview of the post, using the
client's drive path for the image would work beautifully prior to the
image actually being uploaded.

Any suggestions?
...Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
“Anyone who believes in Intelligent Design (“creationismâ€) is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms.†- 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.†Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 
N

Neo Geshel

Steve said:
The filename in the File Upload control is not retained between postbacks.
This is a security feature that cannot be altered.
It may be possible to get around this with client side code, but I'm not
sure I'd recommend that since you'd be overriding carefully thought out
security precautions.

Okay, since all I really need is the raw image data (formatted as
base64), perhaps I can store that data between previews, even as it’s
also being used to show the image itself.

Think this would work?

...Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
“Anyone who believes in Intelligent Design (“creationismâ€) is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms.†- 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.†Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 

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
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top