I am using the WebForm module to allow anonymous guests to the website upload files. They are usually pdfs and some may have 1 and some may have 8. The Webform Module works great, I just would like an option to add another file. Kind of like the attachments portion. I have noticed there is a components directory so if anyone has any ideas of how to make a component or has the patience to work me through creating one, I would be more than happy to help. It seems like there must be some way to make this happen.
I have read through articles about doing this with CCK but I have no idea how to get that to work, Webform seems much simpler and does what I need , I just need to modify it a bit, Any help would be appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | i623692.patch | 1.41 KB | attiks |
Comments
Comment #1
gogowitsch commentedHere is a file to start from: http://blaeul.de/multifile.zip
Extract both files in the archive in your
modules/webform/componentsdirectory, and a new multifile type will be available when you create new components for a webform.Maybe it'll find its way into the webform module. The javascript is from http://www.fyneworks.com/jquery/multiple-file-upload, the Drupal code by myself.
Edit: This component was developed for webform 2.9. It likely works with all 2.x versions of webform, which are now considered insecure. The fix from #7 below has been included in the zip download above.
Comment #2
joshfromdallas commentedCool, works great and exactly what I need. Awesome work!!! I hope this gets put into the webform module!
Only mods on my wish list would be a progress bar during upload
and in the email notification I have it send the person the Files show up with all sorts of stuff:
a:2:{i:0;O:8:"stdClass":10:{s:8:"filename";s:33:"TEST
PDF Table 1 6-12-08.pdf";s:8:"filepath";s:72:"sites/default/files/webform/uploadform/TEST
PDF Table 1 6-12-08.pdf
";s:8:"filemime";s:15:"application/pdf";s:6:"source";s:6:"files0";s:11:"destination";s:72:"sites/default/files/webform/uploadform/TEST
PDF Table 1 6-12-08.pdf";s:8:"filesize";i:60189;s:3:"uid";s:1:"1";s:6:"status";i:1;s:9:"timestamp";i:1264435921;s:3:"fid";s:2:"50";}i:1;O:8:"stdClass":10:{s:8:"filename";s:53:"TEST
PDF Table 2 6-12-08.pdf.pdf";s:8:"filepath";s:92:"sites/default/files/webform/uploadform/TEST
PDF Table 2 6-12-08.pdf";s:8:"filemime";s:15:"application/pdf";s:6:"source";s:6:"files1";s:11:"destination";s:92:"sites/default/files/webform/uploadform/TEST
PDF Table 2 6-12-08.pdf";s:8:"filesize";i:135481;s:3:"uid";s:1:"1";s:6:"status";i:1;s:9:"timestamp";i:1264435921;s:3:"fid";s:2:"51";}}
Any way to clean that up?
I guess I could lock the folder it uploads to down by only giving the admin read and write permisions right?
Comment #3
quicksketchMoving to 3.x since no new features are being added to 2.x. A note that in 3.x, there is now a public API for providing components, meaning this could possibly be an add-on module to Webform rather than being bundled in it, though either way it'll need updating for the new APIs.
Comment #4
scott m. sanders commentedSubscribing.
Comment #5
scott m. sanders commentedDoes this work for 3.x, because I do not see a new "multifile" type on my form's components page nor Webform config after adding those two files to modules/webform/components..?
Comment #6
quicksketchAny components that were written for 2.x will not work with 3.x, as we've had some pretty major API changes.
Comment #7
attiks commented#1: works great, only problem is the link to the file because the language is added in front of the URL
quick fix, line 538
Comment #8
kritro commentedCant get this working with Drupal 6.19 and webform 6.x.3.2
Anyone know how?
Comment #9
mireia commentedHi!
I downloaded the file you mention (multifile.zip) and extracted to /modules/webform/components directory but I cannot see the multifile option in the listbox type in a webform.
I don't know what it is wrong. I hope you could help me because I am getting crazy with this.
Thanks,
Comment #10
derp commentedsubscribe :)
limited results here. It appears i can add files, but they do not get saved on the server. in order to add the new multifile type i added:
to the webform.module file.
any clue on how to make sure files are saved?
Comment #11
sulecki commentedi added a files and paste codes to webform.module but it doesn't attach files... is there anybody who know how to save submitted files?
Comment #12
ravi_os commentedReally Excellant work Christian Bläul (Gogowitsch), never seen sofar for past 3weeks. looking for same kind of functionality.
i tried with the source provided,i m using 6.20. files are not getting uploaded.
i m trying to create a webform in which some fields like fieldset/textfield. I want to provide a provision with "+Add another" button to users to add rather than limited fields.
could anybody guide me in this.
Thanks in advance.
Comment #13
quicksketchLet's keep the priority at what the priority is for Webform as a whole, not for what you need on an individual site. This is still a low priority overall and unlikely to be included any time soon.
Comment #14
favosys commentedI would say this is extremely important and needed. I added 4 file uploads to my form but only one shows up? WTH?
Comment #15
aanjaneyam commentedwill it work in D7 with webform-7.x-3.x.
Comment #16
joshfromdallas commentedLooks like there is still a need for this :)
I am working on a few new sites one of them is D6 and the other is D7 and of course i need mutliple file upload functionality. So I remember this issue from before and get back to this page and find out we are back at the drawing board. Sounds like fun! I am going to attempt to figure out what needs to be changed to get it to work with the new version of webform and D7. Any body that can offer any help, it is greatly appreciated!
Thanks to Quicksketch, I will start with the API. Talk to you all soon I hope!
Comment #17
joshfromdallas commentedSo it looks like a compnent has to be added with the Hook in the API; so I am guessing that is step 1: so I came up with this code
I put it in the module in webform_hooks.php, probably not the right place, I should put it in my template.php right? Anyone have any expireance and guidience for me?
Comment #18
hadsie commentedI needed this for a project, so I've implemented an initial module to handle the multifile uploads here: http://drupal.org/sandbox/hadsie/1143186. It's still very untested but I plan to promote it to a full project in the next little while.
I essentially copied the file component from the webform module and then made it work in a very similar fashion to the original multifile component from comment #1. It seems to be working relatively nicely for me so far.
I also had old webform submissions that used the multifile component from #1 so I've written some code to convert the data from the 2.x multifile to this multifile field. It can be run at the path /webform_multifile_convert_data but be careful as it could still destroy your data :).
Cheers,
- Scott
Comment #19
joshfromdallas commentedCool, Thanks Scott! I will test it out!
Comment #20
ksweet commentedhadsie, you are a life saver! I'm using your module now and it seems to be working great. Thank you very much! I think you should definitely put this on the main d.o module lists as it's extremely helpful (and most people don't know how to checkout git projects)!
Comment #21
ravaka commentedHadsie, you can probably save my life, i downloaded you module, but I can't get work. I have these errors:
Did you have the same errors ksweet ?
Please help :)
Thanks in advance
Comment #22
doublejosh commentedA bit of a late comer on this one, but might I suggest moving from a webform to creating a node with multiple file upload and giving permission to anonymous users?
... this it probably a suggestion for others looking at the thread later.
Comment #23
ravaka commentedI found that the transliteration module make this module to works :). Thank you very much anyway
Comment #24
phelix commentedI have this working properly. well at least the option shows up and the selecting of files and everything is working. But it will not save the files to disk. Or display them in the emails that are received or when viewing the results of the form. Is there something that I am missing here?
Comment #25
newgen commentedis there a way to get a download of the module, I do not know how to get it out of a git project?
thanks
I really need this type of functionality for web form in ver 3, and drupal 6
daniel
Comment #26
joshfromdallas commentedI am haing the same issue, How do you git it?
I donwload git for windows and tried the clone but it is giving me errors saying it is not a repository and stuff?
Anyone have a clue for me?
Comment #27
joshfromdallas commentedI get this:
'git.drupal.org/sandbox/hadsie/1143186.git webform_multifile' does not appear to be a git repository
Comment #28
joshfromdallas commentedNM -
Me thinks I figured it out!!!!
So step 1: Downlaod the Git prog from here: http://git-scm.com/download I use windows and downloaded the msysGit
Step 2 Install it, note you may want to be sure to check the GUI thing, the rest of it I just guessed on and installed.
Step 3 use that prog to clone to a folder on your drive, in the clone box use git://git.drupal.org/sandbox/hadsie/1143186.git
Note: make sure there are no spaces and crap otherwise it will bomb out.
It should then connect and add the files to your local folder. Looks like Hadsie made a module for us, super cool, I am testing now! :)
Comment #29
joshfromdallas commentedI used Hadsie on Drupal 6.22 and webform 3 and all works as advertised! Thanks!
Comment #30
joshfromdallas commentedA quick bug list for the MultiUpload fix above:
- Sometimes the file field doesn't show on the email submission
- When it list the file on the email submission it has a
Comment #31
hadsie commentedHey Guys,
I'm not using the webform module for the project anymore which is why I've not grown the multiupload plugin at all. If someone wants to take it on into a full project please do so.
Cheers,
Scott
Comment #32
Anonymous (not verified) commentedDrupal 7 port and patches for webform multifile upload are in this issue here (still off of hadsie's sandbox...)
--> http://drupal.org/node/1225200
Comment #33
attiks commentedFYI: I created a full project for this, if any one wants to help feel free: http://drupal.org/project/webform_multifile
Comment #34
attiks commentedFor the moment there's no way to send the attachment by email, since the code used to attach the file assumes a a $fid as parameter, which we don't have (we have an serialized array)
I'll try to fix it
Comment #35
attiks commentedI added a new 'hook' _webform_get_files_component, is the hook doesn't exists the old method is used.
Comment #36
quicksketchCould you open a new issue for this patch? It's not a bug as Webform doesn't advertise providing this ability, though it's clearly a limitation that it has special handling for the file component.
Comment #37
attiks commenteddone #1363414: Add new webform callback to allow custom components to attach multiple files
Comment #38
jelle_ssee also #1363416: Send files as attachment
Comment #39
attiks commented#37 is fixed, so should work with Webform Multiple File Upload , see #1363416: Send files as attachment