if ($val->run()) { $car->name = Input::post('name'); // $car->real_file_name = Input::post('file_type'); // $car->file_type = Input::post('file_type'); .... } else { if (Input::method() == 'POST') { if (Upload::is_valid()) { Upload::save(); }
// get the list of successfully uploaded files foreach(Upload::get_files() as $file) { $car->name = $val->validated('name'); $car->real_file_name = $file['name']; $car->file_type= $file['mimetype']; } Session::set_flash('error', $val->error()); } }
So I tried to comment out the main validation section, but it still throws back the errors even though the file saves correctly (which I would like to not... both should fail and rollback if one of the processes fails.)
I would also like this to be able to handle multiple images saving a new row for each image uploaded using the same content entered into the form.
So any ideas on why or how I should setup the action to not throw back the errors on fields I want to set from the uploaded image?