Form HELP

Permalink
Good Afternoon guys,

so I have a document upload form all functional on my site,the default not an add on, can i direct where the file that is uploaded goes?

Can i direct into a different folder, if I can this it would make a nightmare project end!

 
guythomas replied on at Permalink Reply 1 Attachment
guythomas
The existing form block imports any files that are uploaded with the native concrete5 file importer. This places the file into the Concrete5 File Manager and allows you to assign all of the attributes and sets, etc, that C5 does..

If on the other hand you would like the files uploaded to a physical location on your web server, you will need to modify the form controller. Keep in mind, that by using this method, you will no longer be able to access the file with the concrete5 file manager. In addition, this file handling will be applicable to all "Form" blocks you add to your website.

Step 1. Create the following directory

blocks/form

Step 2. download the attached controller.txt file and rename controller.php

Step 3. Upload the "controller.php" file into that directory.

Step 4. Edit the controller.php file at line 12:

public $upload_directory ="uploads/";


Enter the directory you would like the uploaded files to go into.

Step 5. Make sure the directory you specified exists.

That is it. Any files uploaded with the form block will now be routed to the specified directory.

As with all things file system, I can make no guarantee that this will work with your web host. A lot of times certain configurations require different relative or fixed directories to be used when moving files on the server.

If the file is unable to be moved, the form will show an error indicating that the upload failed.

-Guy