raknuth
Posts: 67
|
| Posted: 03/29/2011, 5:15 PM |
|
Hi. I built a form with 3 textboxes. Each texbox will hold the name of a file in the /images folder. The /images folder may contain numerous image files, but the user need only define (1) image file per textbox.
I would like the user to be presented with a list of the files in this /images folder and select one from the list. Can anyone propose an elegant way to do this?
Thank you.
|
 |
 |
jjrjr2
Posts: 131
|
| Posted: 03/29/2011, 9:21 PM |
|
Try using editable grids for your file upload stuff..
I have used that for exactly the same purpose.
John
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us |
 |
 |
raknuth
Posts: 67
|
| Posted: 03/29/2011, 10:11 PM |
|
Hi, JJRJR2. I apologize for being very unclear in my original post. It made sense to me, but did not carry enough detail for anyone else. Oooops!
Here is what I wish to do in each of the 3 textboxes:
* Push a button (or click into the textbox).
* See a view of the files in the /images folder on the remote server.
* Select a file.
* Close the view and have the selected file name appear as the value in the textbox.
It will work similar to the way many color pickers work. But instead of displaying a panel with colors, it will display a panel with the file names from my web site's /images folder.
|
 |
 |
damian
Posts: 838
|
| Posted: 03/30/2011, 4:12 AM |
|
one way i have done this is to upload those files in the first place thru a ccs page and track in the database. then you can use either a listbox (without preview images - only db data) or with radio buttons and thumbnails of the images...
similar outcome but different implementation...
my way is closer to colour picker method... your way is out of my ability :)
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
raknuth
Posts: 67
|
| Posted: 03/30/2011, 6:52 AM |
|
Hi Damian. I created a page to do file uploads in the manner you describe. But it seems like bulky solution to get what I'm looking for. I may have to come back to this, though. Thank you for your suggestion.
|
 |
 |
datadoit
|
| Posted: 03/30/2011, 7:08 AM |
|
You could simply use *CKeditor's file browser directly.
http://sourceforge.net/tracker/index.php?func=detail&ai...348&atid=543655
|
|
|
 |
raknuth
Posts: 67
|
| Posted: 05/15/2011, 11:26 AM |
|
Perhaps I misunderstand what you suggest. I am not looking for an Uploader component. I want to read the files in the remote /images folder, present a list of remote files to the user, and allow him to select a file (preferably by clicking a radio button). The file name would then populate a textbox.
|
 |
 |
damian
Posts: 838
|
| Posted: 05/16/2011, 3:01 AM |
|
are the filenames stored in the database?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
raknuth
Posts: 67
|
| Posted: 05/16/2011, 7:55 AM |
|
No. I wish to read the contents of the remote folder, build a list from that real-time read, and select a file from that list.
|
 |
 |
raknuth
Posts: 67
|
| Posted: 05/16/2011, 11:25 AM |
|
I decided on a different approach. Borrowing in part from Damian's listbox suggestion, I changed the 3 textboxes to 3 listboxes. The data source for each listbox is a ListOfValues. I then placed the following code in the form's Server BeforeShow event, creating an array and populating each listbox from this array.
-----
global $selectFiles;
$selectFiles = array();
$dir = "../images";
$dh = opendir($dir);
while (($file = readdir($dh)) !== false) {
if ($file != "." && $file != ".." && $file != "banners") { // 'banners' is a subfolder of 'images'
$selectFiles[] = array($file,$file);
}
}
closedir($dh);
sort($selectFiles);
$themes->left_photo->Values = $selectFiles;
$themes->center_photo->Values = $selectFiles;
$themes->right_photo->Values = $selectFiles;
-----
I'm going to create a gallery in a modal window or in a new window (using some javascipt) to show the user a thumbnail of each photo in the remote folder.
|
 |
 |