Reputation: 596
I'm trying to create a module that allows users to upload files from the front end. I've seen this asked before but not specifically what I'm trying to achieve.
Basically, I have a 'user dashboard' on the front end.
On that dashboard I'd like a "My files" area that the user can see a list of all the files they've uploaded.
I'm thinking of adding an "Upload file" button which allows the user to obviously upload their file...
This file then gets saved in to the back end of silverstripe in a separate folder (I would imagine, separated by User ID/Name).
I'm not really sure where to start as I'm quite new to back-end development. How would I go about creating this functionality? Would I create a module that somehow extends the upload/files section of the CMS. Can someone point me in the right direction?
Upvotes: 0
Views: 123
Reputation: 1024
Just take a look at the UploadField documentation. You probably want to use setCanPreviewFolder
, setCanAttachExisting
and setAllowedExtension
. Maybe you should also take a look at securing your assets. When you get in trouble coding all this, create a new question with as much info as possible and you will probably get a better answer.
Upvotes: 2