By raptoplob on
Dear lovely people,
I'm trying to create a system on my drupal site where I create 'tasks' that the public can see and authenticated users can work on.
Here is a dummy page to see what I'm roughly going for: http://www.parabolicgames.com/Tasks/dummy-task-1
The trouble I'm having is related to the file upload system. I need authenticated users to be able to upload a file from that page and store it on the server in a place like \files\tasks\dummy-task-1 (with the path changing depending on the title). Then I need an email to be sent to me with the file location and username.
Can anyone suggestion a solution? I've spent a full day looking around and can't find anything concrete.
Thanks
Rob
Comments
tokens + rules
hey,
what I suggest you do is the following;
- install the Token & Rules module.
- create a file upload field on your task content type and use the node title token at the end of your path for the upload location.
- head over to the Rules configuration and create a new rule /admin/config/workflow/rules/reaction/add.
- set it to react on event 'saving a node' (new and/or updated depending on your needs)
- as action select send email and use the tokens to insert data you need in the email.
you can add conditions to have the rule react on the right node type, user role etc.
Good luck!
That's half the task solved
Thanks for the very speedy reply. What you are suggesting sounds really good for the backend element of processing of the upload, thank you.
But I still don't know how to put the upload form within the page itself as I can only get an upload field to appear on the edit page. Any thoughts on this?
Cheers!
Panels?
Hey,
I think you'll be able to do that with Panels, take over the node layout and add the upload field. If it is just for an individual node, you may want to look in Panelizer, I haven't worked with this one myself so I don't kow what limitations it may have, if any, compared to Panels.
If you're not familiar with Panels, I suggest you take out some time to have a look at the documentation and other resources since it is quite a beast to tame.
Solved! (almost)
Webform module provide the functionality of the form and user file upload, including saving locations and emailing me when it occurs!
I haven't quite figured out how to get the form into the content type yet, but this should be a minor issue.
Thanks for the suggestions sjugge!