Re: [html-formfu] using new_result with form that contains File element

2010-01-04 Thread Moritz Onken
> > (...) > if ($form->submitted_and_valid) { >my $cover = $c->request->upload('cover'); >my $inhalt = $cover->slurp; >my $medium = $c->model('DB::Medien')->new_result({}); >$medium->cover($inhalt); >$medium->mime($cover->type); >$form->model->update($medium); > (...) > >

[html-formfu] using new_result with form that contains File element

2010-01-03 Thread Jürgen Hensch
Hi, I have a form that contains a File element whose binary content should be uploaded in my database. The corresponding column in the db is of type BLOB. Right now my "create" action looks like this: (...) if ($form->submitted_and_valid) { my $cover = $c->request->upload('cover'); my $