OK - here is my input form <dtml-in "PARENTS[0].objectValues(['Specimen'])" sort="specimenid"> <dtml-var sequence-item> <input type="file" name="<dtml-var id>" value="Add image to this specimen"><br> </dtml-in> And here is my handling form: <dtml-in "REQUEST.form.keys()"> <dtml-var sequence-item>:<dtml-var expr="_[_['sequence-item']]"><br> <dtml-if "_[_['sequence-item']]"> <dtml-with "_.getitem(_['sequence-item'])"> <dtml-call expr="manage_addProduct['ExtFile'].manage_addExtImage(id='test',file=REQUEST .form[_['sequence-item']], create_prev=1, permission_check=1)"> </dtml-with> </dtml-if> </dtml-in> When I run this I get the html source as Specimen_288:<Specimen instance at 893b520><br> Specimen_289:<Specimen instance at 8874568><br> Specimen_291:<Specimen instance at 8936fb8><br> Specimen_290:<Specimen instance at 86d6868><br> Specimen_293:<Specimen instance at 89d9fe0><br> Specimen_292:<Specimen instance at 88c22c8><br> Specimen_286:<Specimen instance at 893b5e0><br> Specimen_287:<Specimen instance at 87fc188><br> Hope this helps! Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Monday, July 09, 2001 1:42 PM To: Zope Subject: Re: [Zope] filename property of variable I'm a little lost. When I tried it, I got a non-empty string for each file input field that had a filename, and there was an empty string for each one where the user hadn't entered anything. Isn't that what you want? That way, you can test to see if anything was entered. Let me show you what I was testing. Here is my form, with two file-type inputs: <html> <form action='see_request2 '> <input type='file' name='file1'><br> <input type='file' name='file2'><br> <input type='submit' value='Try It'> </form> </html> Here's my handling form, see_request2: <html> <dtml-in "REQUEST.form.keys()"> <dtml-var sequence-item>:<dtml-var "_[_['sequence-item']]"> <dtml-if "_[_['sequence-item']]"> (passed if)</dtml-if><br> </dtml-in> </html> Here's the result, copied for the screen, where I entered "aaa" for the first file name and nothing for the 2nd file name: file1:aaa (passed if) file2: You see, it DOES differentiate between the fields where the user entered a filename and those where the user didn't. Isn't that what you want? If not, I need more clarification. I'm probably assuming something without realizing. Better show us a (shortened) sample of the form, at least. Tom P [Laurie Nason]
I tried this and it doesn't differentiate between ones where the user has entered a file to upload and ones where they haven't. I really need to be able to call the .filename method to see if it has one - but _['sequence-item'].filename doesn't like the fact that the _['sequence-item'] returns a string (thanks Casey again on a different post!) rather than the object itself. What I would like to be able to do is to call <dtml-if expr="_.getitem(sequence-item).filename">
But you can't escape the sequence-item again due to the fact that it returns a string...AARRGGHHH!!!
Any ideas???
_______________________________________________ Zope maillist - Zope@zope.org 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 )