Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Can we define the upload directory in userforms?


Go to End


3 Posts   1760 Views

Avatar
AlaVive

Community Member, 42 Posts

10 June 2010 at 7:11am

What do I do to change the default upload location for the files uploaded through Userforms? Isn't there a config setting or a a file to modify?

The general "Uploads" directory can easily become a mess...

Avatar
Willr

Forum Moderator, 5523 Posts

10 June 2010 at 6:04pm

Not yet. But this is on the roadmap http://open.silverstripe.org/ticket/5563

Avatar
jamie

Community Member, 4 Posts

18 January 2011 at 3:46pm

If you want to change the directory that the file is uploaded to, in UserDefinedForms.php just add a third variable to the line
$upload->loadIntoFile($_FILES[$field->Name], $file);
with the directory that you want the files to go to. The directory is relative to the assets folder so
$upload->loadIntoFile($_FILES[$field->Name], $file, 'Uploads/folder');
will upload to 'assets/Uploads/folder'