|
 |
|
ถ้าใช้ uploadifive อยากให้ออกมาเป็นแบบนี้ ต้องเปลี่ยนตรงไหนอะไรยังไงครับ |
|
 |
|
|
 |
 |
|
หมายถึงลงแบบ BLOB หรือเปล่าครับ
PHP Upload MySQL BLOB Image
|
 |
 |
 |
 |
Date :
2014-05-12 09:25:43 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เข้าใจอยู่ดีอ่ะครับ ผมต้องการใช้ตัว Uploadifive เพื่อทำการ Multi select รูปภาพอ่ะครับ แต่พอทำแล้ว มันก้เก็บรูปแรกเอง ไม่เก็บทั้งหมด
|
 |
 |
 |
 |
Date :
2014-05-12 11:06:18 |
By :
Harizadoz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้ผมย้ายไฟล์ มาไว้ใน Folder ได้แล้วครับ แต่เหลือ ขั้นตอน Connect DB อันนี้มึนมาก
Code (PHP)
// Set the uplaod directory ex.C:/Appserv/www"/TEST/uploads/"
$uploadDira = '/TEST/uploads/';
// Set the allowed file extensions
$fileTypes = array('jpg', 'jpeg', 'gif', 'png'); // Allowed file extensions
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$uploadDir = $_SERVER['DOCUMENT_ROOT'] . $uploadDira;
$targetFile = $uploadDir . $_FILES['Filedata']['name'];
// Validate the filetype
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array(strtolower($fileParts['extension']), $fileTypes)) {
// Save the file
if (move_uploaded_file($tempFile, $targetFile)){
echo "complate Upload";
$objconnect = mysql_connect("localhost","root","*****") or die ("Error Connect To Database");
$objDB = mysql_select_db("mydb");
$strSQL = "insert into album_home";
$strSQL ="(AlbumName,AlbumShot) values ('".$_POST["txtAlbumName"]."','".$targetFile."')";
$objQuery = mysql_query($strSQL);
mysql_close($objconnect);
}
} else {
// The file type wasn't allowed
echo 'Invalid file type.';
}
}
|
ประวัติการแก้ไข 2014-05-12 13:24:06
 |
 |
 |
 |
Date :
2014-05-12 13:22:56 |
By :
Harizadoz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้หละครับ เชิ้อมฐานข้อมูลได้เรียบร้อบ
Code (PHP)
<?php
/*
UploadiFive
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
*/
// Set the uplaod directory ex.C:/Appserv/www"/TEST/uploads/"
$uploadDira = '/TEST/uploads/';
// Set the allowed file extensions
$fileTypes = array('jpg', 'jpeg', 'gif', 'png'); // Allowed file extensions
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$uploadDir = $_SERVER['DOCUMENT_ROOT'] . $uploadDira;
$targetFile = $uploadDir . $_FILES['Filedata']['name'];
// Validate the filetype
$fileParts = pathinfo($_FILES['Filedata']['name']);
$objconnect = mysql_connect("localhost","root","*****") or die ("Error Connect To Database");
$objDB = mysql_select_db("mydb");
if (in_array(strtolower($fileParts['extension']), $fileTypes)) {
// Save the file
move_uploaded_file($tempFile, $targetFile);
$thisname = $_FILES['Filedata']['name'];
mysql_query("INSERT INTO `album` (`AlbumName`)
VALUES ('$thisname')");
mysql_close($objconnect);
echo "complete Upload";
} else {
// The file type wasn't allowed
echo 'Invalid file type.';
}
}
?>
|
 |
 |
 |
 |
Date :
2014-05-12 13:56:19 |
By :
Harizadoz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|