Jump to content
  • Advertisement
Sign in to follow this  
SteveDeFacto

[web] I want to be able to upload images like Ebay does but how?

This topic is 3118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When you create a new listing on ebay an upload window pops up, you select the file using standard file type input and submit the form. Some how the upload page tells the main window which opened the upload window to now display the image then closes the upload window. I got a window to pop up and display a form which has a file type input and a submit button, when the user hits the submit button it submits the form to upload.php but what code should be in this file to tell it to update the main window and close?

Share this post


Link to post
Share on other sites
Advertisement
Hello SteveDeFacto,

assuming you are using PHP or ASP.Net for this you could do this with Ajax.

http://en.wikipedia.org/wiki/Ajax_%28programming%29

Maybe you should tell a little bit more about you programm/page. Maybe there is a way to use some redirects or reload a page.

http://en.wikipedia.org/wiki/Wikipedia:Redirect

-GWDev

Share this post


Link to post
Share on other sites
Have a look at SWFUpload.
It allows multiple uploads, upload progress reporting, cancelation of uploads.
Pretty good examples how to code the upload form too.

Share this post


Link to post
Share on other sites
Quote:
Original post by SteveDeFacto
When you create a new listing on ebay an upload window pops up, you select the file using standard file type input and submit the form. Some how the upload page tells the main window which opened the upload window to now display the image then closes the upload window.

I got a window to pop up and display a form which has a file type input and a submit button, when the user hits the submit button it submits the form to upload.php but what code should be in this file to tell it to update the main window and close?


Your upload handler returns a little HTML containining JS which does the aformentioned things.
Something like

<script>
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
}
window.close();
</script>


[Edited by - Konfusius on March 9, 2010 1:23:46 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Konfusius
Quote:
Original post by SteveDeFacto
When you create a new listing on ebay an upload window pops up, you select the file using standard file type input and submit the form. Some how the upload page tells the main window which opened the upload window to now display the image then closes the upload window.

I got a window to pop up and display a form which has a file type input and a submit button, when the user hits the submit button it submits the form to upload.php but what code should be in this file to tell it to update the main window and close?


Your upload handler returns a little HTML containining javascript which does the aformentioned things.
Something like

<script>
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
}
window.close();
</script>


Thank you so much, thats exactly what I wanted!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!