Forums
This topic is locked
Select Existing Image or Upload New
Posted 12 Apr 2005 17:19:29
1
has voted
12 Apr 2005 17:19:29 Matt Bailey posted:
I have Pure PHP Upload, which works fine. However, I want to give the user the choice of picking an already uploaded image if they want to. I haven't got the luxury of being able to buy the Image Gallery Add-On or File Genie so was wondering if anyone could point me in the right direction. I don't mind doing a bit of googling, but I don't really know where to start or what I'm looking for.___________________________________
* Sorry... how do you do that again?... *
Replies
Replied 12 Apr 2005 23:10:26
12 Apr 2005 23:10:26 Matt Bailey replied:
I think what I need to do is have a pop up window where the user can select an image and then have the file name of the image they want be sent to the main page somehow ready to be submitted with the rest of the infomation.
Can anyone give me some pointers on how to do this?
___________________________________
* Sorry... how do you do that again?... *
Can anyone give me some pointers on how to do this?
___________________________________
* Sorry... how do you do that again?... *
Replied 13 Apr 2005 10:14:02
13 Apr 2005 10:14:02 Matt Bailey replied:
After a sleepless night I think I've had a bit of a brainwave. It's not exactly like what I wrote about above, but it's a good solution. I'll post it here in case anyone else is trying to get their head around a similar problem Here's the scenario:
A CMS with (amongst other things) a news and gallery section. The news and gallery sections share the same image folder because the news stories often relate to gallery items. This is why I want the user to be able to select an image already on the server if they want to, rather than keep uploading new ones - makes sense...
My solution:
Rather than have an image upload file field on the 'add news item' page and also on the 'add gallery item' page I'm going to create a separate 'image library' upload page. The client can use this page for all their image upload 'needs' regardless of which section of the site they want them to be shown in. Then on the 'add news item' and 'add gallery item' pages I will simply put a dynamincally populated dropdown menu (I thought about showing thumbnails, but there's already a good 100+ images on the server) so they can pick the image they just uploaded, or another if they wish. If they forget to upload or choose an image a default image will be displayed until they upload an image using the 'image library' page and then go back and edit the 'news' or 'gallery 'item'...
And there you have it. Not perfect, but an adequate solution, and it also means I only have to create all the image upload stuff once, on one page and not a number of times for each section that needs an image upload facility.
___________________________________
* Sorry... how do you do that again?... *
A CMS with (amongst other things) a news and gallery section. The news and gallery sections share the same image folder because the news stories often relate to gallery items. This is why I want the user to be able to select an image already on the server if they want to, rather than keep uploading new ones - makes sense...
My solution:
Rather than have an image upload file field on the 'add news item' page and also on the 'add gallery item' page I'm going to create a separate 'image library' upload page. The client can use this page for all their image upload 'needs' regardless of which section of the site they want them to be shown in. Then on the 'add news item' and 'add gallery item' pages I will simply put a dynamincally populated dropdown menu (I thought about showing thumbnails, but there's already a good 100+ images on the server) so they can pick the image they just uploaded, or another if they wish. If they forget to upload or choose an image a default image will be displayed until they upload an image using the 'image library' page and then go back and edit the 'news' or 'gallery 'item'...
And there you have it. Not perfect, but an adequate solution, and it also means I only have to create all the image upload stuff once, on one page and not a number of times for each section that needs an image upload facility.
___________________________________
* Sorry... how do you do that again?... *
Replied 13 Apr 2005 13:57:26
13 Apr 2005 13:57:26 Dave Thomas replied:
personally i'd create the upload stuff as many times as was needed. u can always just write it once, throw it in an include file, and then reference it elswewhere when it was needed.
what your saying reminds me of one i had to work on last year, and it was a good six clicks to edit a photo url. needless to say that burnt my head out.
regards
Dave Thomas
<b>DMX Zone Manager</b>
what your saying reminds me of one i had to work on last year, and it was a good six clicks to edit a photo url. needless to say that burnt my head out.
regards
Dave Thomas
<b>DMX Zone Manager</b>
Replied 13 Apr 2005 14:13:49
13 Apr 2005 14:13:49 Matt Bailey replied:
The problem I have though is trying to combine on one page the ability to upload a new image or select an existing one - ie you can't have a file field for uploading and a dropdown menu for selecting an existing image both with the same name, so how can I make my code processes either/or depending on what the user wants to do.
I don't know enough about PHP to figure this one out, so the solution that came to me is the best way I can think of to get round this... any more pointers would be gratefully received though.
___________________________________
* Sorry... how do you do that again?... *
I don't know enough about PHP to figure this one out, so the solution that came to me is the best way I can think of to get round this... any more pointers would be gratefully received though.
___________________________________
* Sorry... how do you do that again?... *