how to store only the filename in the database and the file on the file system. code example
Example: tina4 save file to database in orm
//Save a block on content to table , field name is content
$page->saveBlob("content", $request->params["content"]);
//Save an uploaded file to field name image, field type is longblob / blob in the database
$page->saveFile("image", "image"); //expecting $_FILES["image"]