I have installed the new webform module, which is very nice, but I'd like to add a file upload to the form.
(People who use the form may upload their curriculum).
Do you know a way to achieve this ? Thanks !

Comments

quicksketch’s picture

elv,
I got your email also and I thought I'd repost part of it here for other people with the same question.

What I understand is that just adding a file upload field (as a component
to the module)is not enough. Unlike the texts entered in webform fields
which are immediately available, the file has to be uploaded and
processed. This is where I'm stuck. I guess the needed functions are
already in file.inc but I don't know where to begin.
Do I have to store the file and give it a path ?
Is there a way to add it to the mail content (then the mail should be a
multipart/form-data) ?

You're right about everything. Right now webform can't handle file uploads because they require additional processing on the server side. I've received suggestions to share components with flexinode, which seems like a better idea all the time. Webform currently works in quite a different manner than flexinode, so it would require some large changes to the infrastructure of webform. So the answer is pretty much, 'not yet'.

Nathan Haug
creative graphic design        w: quicksketch.org
& software development       e: nate@quicksketch.org

elv’s picture

quicksketch, thanks for your reply!

So I guess I need to find another way :) Apart from webform / mail_form, is there a way to let visitors upload a file?

quicksketch’s picture

elv, you could try using flexinode. Create a new content type with all the fields you want to include, plus one for uploading files of course (this is a built in type of flexinode). Make it so anonymous users can create new nodes of this type. You could then theme this content type so that only authenticated users could access the information.

Now if you wanted to have users actually email files to you instead of simply uploading them... I don't really know. Flexinode has a lot of customizeable options and is really easy to theme, but emailing isn't one of it's features. I wish I could help more, but I don't yet have the time to implement such a feature into webform. Look into flexinode if you haven't already.

Nathan Haug
creative graphic design        w: quicksketch.org
& software development       e: nate@quicksketch.org