grgbikash05's avatar

Php mysql database not uploading the file

Ive tried uploading the file that is exported from adobe xd. It is not uploading into the database.

0 likes
2 replies
Wakanda's avatar

let's see what you have tried so far?

grgbikash05's avatar

$file1 = file_get_contents($documentFile1);

				$sql6 = "INSERT INTO tblfileattachment (DocumentTypeID, EmployeeID, FileData, FileName, FileType, FileSize, CreatedBy) "
				. "VALUES(:doctype, :employeeID, :file, :fileName, :fileType, :fileSize, :createdBy)";
				$stmt6 = $this->pdo->prepare($sql6);
				$stmt6->bindParam(':doctype', $documentTitle1);
				$stmt6->bindParam(':employeeID', $empid);
				$stmt6->bindParam(':file', $file1, PDO::PARAM_LOB);
				$stmt6->bindParam(':fileName', $documentFile1Name);
				$stmt6->bindParam(':fileType', $documentFile1Type);
				$stmt6->bindParam(':fileSize', $documentFile1Size);
				$stmt6->bindParam(':createdBy', $employeeID);
				$fileAttachment1ID = $this->insert($stmt6);

Please or to participate in this conversation.