Thanks ! I've found a solution.
I post my code, this could help if somenone else have same issu one day.
PHP Code:
$strFolder = "files/cars/photos"; //Folder
$strFile = $matches[0]; //FileName
$path = $strFolder . "/" . $strFile; //Relative Path
$fpath = IMGS . $matches[0]; //Full Path
if (!file_exists($fpath) || md5_file($fpath) != $matches[2]){
$this->getFile($conn_id,$fpath,$matches[1]);//custom function for download file
$md5 = md5_file($fpath);
$uuid = \String::UuidToBin($md5);
$db->prepare("INSERT IGNORE INTO tl_files (tstamp, pid, uuid, type, path, extension, hash, name) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")->execute(time(), $uuid, $uuid, 'file', $path, 'jpg', $md5, $strFile);
}
Bookmarks