Image Upload From Page A, Display on Page B?

  • Thread starter Thread starter pbd22
  • Start date Start date
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.
 
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.
 
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)
 
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.
 
Back
Top