Image Upload From Page A, Display on Page B?

P

pbd22

Hi there.

This one has me really confused.

I need to program the following behavior:

1) A user clicks on "Select Pictures" on Page A.
2) A pop-up window (Page B) appears and he selects his images.
3) He clicks "upload" - the images are send to the image server
and when the task completes, Page B closes.
4) Now, when the user sees Page A again, it has a display of
all the images he uploaded using Page B.

Can somebody explain to me how Page A knows how to load the recently
uploaded images (from Page B) without further action from the user?

Page A (opens pop-up)-> Page B (does upload)-> Page A (displays
recently uploaded images)?

My initial thought was that "Select Pictures" also starts a long
polling process that returns the image URLs once the uploads are
complete but I am hoping somebody out there has a less kudgey
suggestion?

Thanks for your time.
 
G

Guest

Hi there.

This one has me really confused.

I need to program the following behavior:

1) A user clicks on "Select Pictures" on Page A.
2) A pop-up window (Page B) appears and he selects his images.
3) He clicks "upload" - the images are send to the image server
and when the task completes, Page B closes.
4) Now, when the user sees Page A again, it has a display of
all the images he uploaded using Page B.

Can somebody explain to me how Page A knows how to load the recently
uploaded images (from Page B) without further action from the user?

Where do you upload the file? I guess it's a directory on the server.
So, just show all files from the directory on Page A. At the
beginning, when directory has no files you will not see anything. Once
upload is finished, you should see the file.
 
B

bruce barker

page b can use javascript to notify its parent (window.opener) when the
upload is complete. in page a define script:

<script>
function refreshImages() {
// update images
}
</script>

on page b on postback

ScriptManager.RegisterStartupScript(this,
this.GetType(),
"refresh",
@"if (window.opener && window.opener.refreshImages)
window.opener.refreshImages();
window.Close();",
true);

-- bruce (sqlwork.com)
 
P

pbd22

page b can use javascript to notify its parent (window.opener) when the
upload is complete. in page a define script:

<script>
function refreshImages() {
        // update images}

</script>

on page b on postback

ScriptManager.RegisterStartupScript(this,
        this.GetType(),
        "refresh",
        @"if (window.opener && window.opener.refreshImages)
                window.opener.refreshImages();
          window.Close();",
        true);

Thanks Bruce.

That partially worked. I am able to call the javascript function on
the
opening page, thanks. I am assuming that "refreshImages" is some sort
of xmlhttprequest that populates the image src attributes. But,
window.Close();
does not work. Focus shifts to the opening page but the pop-up remains
in the background and never closes.

Any ideas? Thanks again.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top