Forum OpenACS Q&A: Re: Using "file" widget with ad_form

Collapse
Posted by Jun Yamog on
Hi Dave,

Use this on ad_form

    {upload_file:file(file),optional {label "File"}}

Then on -edit_data or somewhere else on ad_form use this

    # get the file properties
    set upload_filename [template::util::file::get_property filename $upload_file]
    set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file]
    set upload_mime_type [template::util::file::get_property mime_type $upload_file]

You can also see my code in file-upload.tcl, it uses the wizard, ad_form, etc.