我想将我的PDF从$ _FILES插入我的MSSQL数据库(ERP系统)。 所以,如果我插入这个我得到以下来自SQL Server的错误消息: 102如果我写下来,如果我写下来:铸造附近的Dokument,如果我也设置它':Dokument'在Cast附近然后我得到这个错误类型002(null)[0](严重性0)[(null)]
$filetemppath = $_FILES["_NDAUPLOAD"]["tmp_name"];
$filename = $_FILES["_NDAUPLOAD"]["name"];
$filesize = $_FILES["_NDAUPLOAD"]["size"];
$extract = fopen($filetemppath, 'r');
$content = fread($extract, $filesize);
// Überprüfe Upload
if(!get_magic_quotes_gpc()){
$filename = addslashes($filename);
$content = addslashes($content);
}
fclose($extract);
$docsql = "INSERT INTO DOKUMENT (Typ, Dateiname, Dokument, JournalID) VALUES (2, :Dateiname, (Cast (:Dokument AS varbinary(max))), NEWID()))";
$d = $db->prepare($docsql);
$d->bindParam(':Dateiname', $filename);
$d->bindParam(':Dokument', $content);
$de = $d->execute();