I have the following form
species_form = form_factory(
Field('species', 'text', label=TAG['']
("Yeast",BR(),"Systematic Names")),
Field('species_file', 'upload', label="Upload Names",
uploadfolder=os.path.join(request.folder, 'tmp')),
)
I want he text field to be filled with the content of the uploaded
file if there a file was uploaded
species_file = request.vars.species_file.file.read() if
request.vars.species_file!=None else ''
if species_form.accepts(request.vars, session, keepvalues = True):
if species_form.vars.species_file:
hits = re.findall('Y\w+', species_file)
species_form_elem =
species_form.element(_id="no_table_species")
species_form_elem["value"] = ' '.join(hits)
But this does not work? Is there a different way to do this?
Also I wonder if there is a method to upload the file without ever
storing it? If I remove the uploadfolder argument it does not work. I
really dont want to store the file at all.