I have a problem with saving files on server (linux). On localhost (Windows) is function OK.
umask(007);
if (file_put_contents($path, (string) $data) === false) {
log("error", "error create file");
}
$path
is OK, because file is created - but empty.
$data
are PDF file ("%PDF-1.4...") or jpg file
gettype($data)
returns "string"
Add string to this variable is OK too.
Thank you very much for your opinions.