This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

phplee
phplee

Im trying to upload a file in my fronted form. Have set the relationship up in my model as

public $attachOne = [
    'attachments' => ['System\Models\File', 'public' => true]
];

and in my component i have this:

$uploadedFile = Input::file('proof_of_id');
    $file = new File;
    $file->data = $uploadedFile;
    $file->is_public = true;
    $file->save();

but when i submit the form i get:

Call to undefined method October\Rain\Support\Facades\File::save()

i have 'use File' in my component. but don't understand why the save() us undefined.

any help would be great

daftspunky
daftspunky

Try this instead

$file = new System\Models\File;

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.