How can i go about this?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Mar 2008
Posts: 18
Reputation: dele454 is an unknown quantity at this point 
Solved Threads: 0
dele454's Avatar
dele454 dele454 is offline Offline
Newbie Poster

How can i go about this?

 
0
  #1
Sep 3rd, 2008


Hi,

I have a galleries page in the CMS am developing that looks like the above. This section of the page allows the admin to upload multiple pictures taken by a photographer. On clicking the 'edit' button on any thumbnail - whether a blank or already uploaded pic thumbnail, the custom pop-up window is seen. Which allows you to upload a thumbnail image with its corresponding large size.

On save from the pop-up window, images are uploaded and the thumbnail from which the edit button was clicked is replaced with the thumbnail of the uploaded image.

Am just wondering how i can go about coding this. I want to use AJAX + PHP since i dont want the whole page to reload on uploads. Do i need to use a javascript library like Dojo/JQuery to simplify things?

For the custom pop-up window - should that be a styled DIV with all input file element that gets since onclick of Edit button?

Am very new to AJAX - though i understand the concept. Please help is needed on how i can tackle this. Thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: How can i go about this?

 
0
  #2
Sep 3rd, 2008
Hi,

I've just been working with a CMS for a client involving image-management, ajax, mysql, et.al ...

You need to know that you can not upload files using Ajax. The best work-around (that I know of) for this is uploading the file with a page inside an iframe and having the iframe document talk to its parent document (onload) with JavaScript.

So this way the upload page is inside an iframe in the main page. The user clicks the upload submit and the image uploads to the server-side script (optionally PHP on the same page ... ) and when the server-side script is done handling the upload it tells it's parent window what is necessary to make the changes in the main window.

Quick example of child iframe onload call to parent function ...
window.onload = function () {
parent.image_uploaded( image_path );
}


Hope this saves you some head-banging, let me know if you have any more questions.
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC