I'm using October CMS.
I made a simple front-end File Upload Plugin. I have a Model and Component.
In Model Uploader.php I use
public $attachOne = [
'videofile' => 'System\Models\File'
];
And in the Component
public function onUpload(){
$uploader = new Uploader();
$uploader->videofile = Input::file('videofile');
$uploader->save();
Flash::success('File Uploaded');
return Redirect::back();
}
By default, Uploads go to
/storage/app/uploads/public/random-dir/random-name.mp4
The CMS is giving the files a random directory and name.
But backend Media Uploads go to
/storage/app/media/filename.mp4
The File name is preserved.
How do I make the files upload to /media instead of /uploads/public?
Or is it possible to define a folder and filename instead of random in /uploads/public?
