Re: [1.3] file uploads

Philipp Stucki <[email protected]>
Newsgroups gmane.comp.cms.bitflux.general
Message-ID <[email protected]>
qMax wrote:
> I need also to know which fields are of type 'file',
> so seems there's no common way to handle this, and there have
> to be coded specific handler for each particular form with uploads.
> Or, i can pass them as parameters.

As our default form mailer doesn't currently support file uploads, you
will have to write that part on your own. You could either send us a
nice patch or you could copy and extend the form2mail handler. As you
want to use PEAR_Mail you will have to write your own handler anyway.

A quick hack to handle file upload fields would be to prepend all the
file field's names with e.g. "upload_". In the "submitFields" method of
your handler you could then easily identify them as file fields.

Another solution would be to pass the patForms form object to the
handler and then use getElementByName for every field which returns the
element object of the field. Using that object you would be able to
identify fields of type "file".

philipp


-- 
philipp stucki . bitflux GmbH . schoeneggstrasse 5 . CH-8004 zurich
[email protected]  .  phone +41 1 240 56 70 .  fax +41 1 240 56 71
http://www.bitflux.ch
-- 
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.