[Zope] Newbie: Listing filesystem objects?
NewbieQ of the moment: So there's a folder on my server, call it \\server\files\logos. I want to list its contents in a drop-down listbox in a form; something like select name="logo_filename" option selected value="default.jpg"default.jpg option value="file1.jpg"file1.jpg ... /select Needless to say, I've installed the local filesystem product and created a localfs object called "logos" that maps to the correct folder. And now I'm mired in the docs. I'm thinking that I can just use dtml-in to iterate through the file ids of the objects in that folder, but I'm damned if I can see *how* to do that. Any tips? -- Andy Gates, Learning and Research Technology [EMAIL PROTECTED] - ICQ#74362415 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Newbie: Listing filesystem objects?
Andy Gates writes: NewbieQ of the moment: So there's a folder on my server, call it \\server\files\logos. I want to list its contents in a drop-down listbox in a form; something like select name="logo_filename" option selected value="default.jpg"default.jpg option value="file1.jpg"file1.jpg ... /select Needless to say, I've installed the local filesystem product and created a localfs object called "logos" that maps to the correct folder. And now I'm mired in the docs. I'm thinking that I can just use dtml-in to iterate through the file ids of the objects in that folder, but I'm damned if I can see *how* to do that. Any tips? You can use the "fileIds" method of "LocalDirectory". There are "fileValues" and "fileItems" methods, too. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Newbie: Listing filesystem objects?
This is adapted from much more involved production code and should work: select name="filenames" size=10 dtml-in "local_fs_object.fileValues(spec='*.*')" dtml-let thefile="_['sequence-item'].id" option value="dtml-var thefile"dtml-var thefile/option /dtml-let /dtml-in /select Jim Sanford - Original Message - From: "Andy Gates" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 13, 2000 7:57 AM Subject: [Zope] Newbie: Listing filesystem objects? NewbieQ of the moment: So there's a folder on my server, call it \\server\files\logos. I want to list its contents in a drop-down listbox in a form; something like select name="logo_filename" option selected value="default.jpg"default.jpg option value="file1.jpg"file1.jpg ... /select Needless to say, I've installed the local filesystem product and created a localfs object called "logos" that maps to the correct folder. And now I'm mired in the docs. I'm thinking that I can just use dtml-in to iterate through the file ids of the objects in that folder, but I'm damned if I can see *how* to do that. Any tips? -- Andy Gates, Learning and Research Technology [EMAIL PROTECTED] - ICQ#74362415 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )