을 저장하기 위해 당신이 원하는 솔루션에 phpMyAdmin을한다 사용하고 있습니다 : 서버 5 개 파일을 업로드 메모리와 base64_encode
로 읽을되면 합니다.
예. 당신이 가지고 있기 때문에
$files = array(
'file1' => base64_encode(file_get_contents('/path/to/file1')),
'file2' => base64_encode(file_get_contents('/path/to/file2')),
'file3' => base64_encode(file_get_contents('/path/to/file3')),
'file4' => base64_encode(file_get_contents('/path/to/file4')),
'file5' => base64_encode(file_get_contents('/path/to/file5')),
);
// serialize
$filesData = serialize($files);
// put $filesData in db column
// when your retrieve it later from database, unserialize and use array
$files = unserialize($columnValue);
파일은 메모리를 int로하고, 당신은 Content-Transfer-Encoding: base64
에 첨부 파일을 추가 할 수 있습니다 base64 인코딩이다.
파일을 가져 오기 위해 데이터를 직렬화 해제 할 때 "Array"라고 쓰여집니다. 어떻게 링크를 다운로드하여 실제 파일을 다운로드 할 수 있습니까? [BLOB - 712.9KiB]와 같이 파일 데이터가 저장되는 열의 데이터베이스에서도 클릭하려고하면 파일이 표시되므로 .bin 유형이 저장됩니다. .jpg 파일 –
@ HanyaIdrees를 보냈습니다. 다른 문제입니다. 링크로 파일을 표시하려면 파일 ID (예 :'download.php? email = xxx & fileId = xxx')를 취하는 새 페이지를 만들어야합니다. 여기에 데이터베이스 + 'header ('Content-Type : image/jpeg') '또는 무엇이든 파일을 설정하고 파일 데이터'die ($ base64DecodedFile) '를 표시하여 파일을 표시 한 모든 파일을'unserialize'하고 'base64_decode' '. – Alex
나에게 튜토리얼 링크 나 다른 도움 링크를 제공해 주시겠습니까? 저는 PHP 초보자입니다. 그러니 제발 –