Me again ,-)
Of course it's easy and I can see you rolling with your eyes... :) But I didn't see exactly what to do to get the file uploaded.
class StdBoard extends \koolreport\dashboard\Dashboard
{
protected function widgets()
{
return [
Html::h2('Heilmittel: STD-Datei-Verarbeitung'),
Html::hr(),
Row::create()->sub([
Html::p('fileliste'),
Panel::create()->header('STD-Upload')->type('primary')->sub([
FileUploader::create('std_uploader')
->type('primary')
->accept(["std"])
->saveToFolder(public_path(env('HM_STD_PATH')))
->fileName(function($name,$ext){
return $name.".".$ext;
})
->resolveValue(function($file){
return $file["name"];
})
->fileNotAllowedError("Dateityp nicht erlaubt.")
->fileSizeLmitError("Datei ist zu groß!")
->unknownError("So mysterious")
->noFileError("Keine Datei ausgewählt!")
->noFileSelectedText("Keine Datei ausgewählt!")
->selectFileText("STD-Datei auswählen..")
])
]),
];
}
}
This is what I've done so far. The FileUloader is working, mainly copied from your documentation.
Now I want to create a Button to upload the selected File, but (maybe it's not my day today...) I don't know how I have to connect that.
Can you help me again?
Thanks, Peter