Form actions
Permalink 1 user found helpful
I am using extended forms, but I want to use a phpdocx action for the form. Basically I want to gather the form input, store it in my database, and generate a .docx file from the input, store it in the database, or in a directory on the server and provide a redirect page with a link to download the .docx file from. I would like for the download links to be persistent, so anytime a user logs in, they can go to the page or pages and download any of the docs at any time. I just am not quite sure where to start. I am more than happy to do the hard work, I just need a point to start.
Regards,
Scott
Regards,
Scott
Yes, it would be by individual user. Basically I want to have a membership area where the user can create the documents and have them stored there as long as they want.
Thank you for your reply, this gives me some great info to start the work, I really appreciate it.
Scott
Thank you for your reply, this gives me some great info to start the work, I really appreciate it.
Scott
There are many ways to crack this nut, but here is what I would do:
1) Add a method to the Controller for the PageType or SinglePage you have the form on.
2) Create a form with the action as the method name
3) Post the form data
4) In the method, use your docx library to create a file in tmpfs (or whatever) from the form values.
5) Use the various library methods you find in the Concrete5 importers to import the file into C5
6) Decorate the file with whatever extra metadata or set membership you need.
As far as how to display them goes, I don't know anything about your use case, so I can't help you there... are files associated with individual users? With groups? With pages? With the phase of the moon? You're going to have to figure out the entity relationship and model that with sets and attributes.
In my current project, I have created an attribute for a Page to hold the FileSetID of a group of files related to it. Maybe that will work for you.