php upload รูปขึ้น host พออัพแร้วติดอย่างนี้คะ ช่วยหน่อยนะคะ ติดมาหลายชั่วโมงแร้ว ส่งงานพรุ่งนี้ด้วย T_T
ติดแบบนี้คะ
Code
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'Thumnail/90317993.jpg' for writing: Permission denied in /xxxxxxx/PageUploadToMySQL2.php on line 66
Resize Successful.
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'Thumnail/0197851583001.jpg' for writing: Permission denied in /xxxxxxxx/PageUploadToMySQL2.php on line 66
Resize Successful.
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'Thumnail/6ce53caad67111e1bfbf22000a1e8863_7.jpg' for writing: Permission denied in xxxxxxxxx/PageUploadToMySQL2.php on line 66
Resize Successful.
code นะคะ ช่วยหน่อยคะ ไม่ไหวแร้ว
Code (PHP)
<?
include("../include/session.php");
include "auth.php";
include("chk_admin.php");
?>
<div class="bg1">
<div class="main">
<div class="box">
<?
if ( isset($_FILES['filUpload']['tmp_name']) && $_FILES['filUpload']['tmp_name'] != '' )
{
echo "fly";
if(copy($_FILES['filUpload']['tmp_name'],"Gallerymodel/".$_FILES['filUpload']['name']))
{
echo "Copy/Upload Complete<br>";
}
}
for($i=0;$i<count($_FILES["fileUpload"]["name"]);$i++)
{
$path_imagesori = $_FILES["fileUpload"]["name"][$i];
if(trim($_FILES["fileUpload"]["tmp_name"][$i]) != "")
{
$images = $_FILES["fileUpload"]["tmp_name"][$i];
$new_images = $_FILES["fileUpload"]["name"][$i];
if ( isset($_FILES['filUpload']['tmp_name']) && $_FILES['filUpload']['tmp_name'] != '' )
{
echo "fly";
copy($_FILES['fileUpload']['tmp_name'][$i],"Gallerymodel/".$_FILES['fileUpload']['name'][$i]);
}
$width=100; //*** Fix Width & Heigh (Autu caculate) ***//
//$width2=450;
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
//$height2=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
//$images_fin2 = ImageCreateTrueColor($width2, $height2);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
//ImageCopyResampled($images_fin2, $images_orig, 0, 0, 0, 0, $width2+1, $height2+1, $photoX, $photoY);
ImageJPEG($images_fin,"Thumnail/".$new_images);
//ImageJPEG($images_fin2,"Test/".$_FILES["fileUpload"]["name"][$i]);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
//ImageDestroy($images_fin2);
echo "Resize Successful.<br>";
//*** select Record ***//
include "connectdb.php";
$strSQL = "INSERT INTO gallery ";
$strSQL .="(AlbumID,GalleryShot) VALUES ('".$_GET["AlbumID"]."','".$path_imagesori."')";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
mysql_close($objConnect);
}
}
?>
<br>
<a href="photoalbum.php?AlbumID=<?=$_GET["AlbumID"];?>" class="button link3">เลือกหน้าปกอัลบั้ม</a>
<a href="view_album.php" class="button link3">View files</a>
</div></div></div>
</body>
</html>
Tag : PHP, MySQL
Date :
2012-08-27 01:30:01
By :
suphat
View :
966
Reply :
1
chmod ให้โฟเดอร์เก็บรูปภาพเป็น 777 หรือยังครับผม
หากทำไม่เป็นลองค้น Google คำว่า chmod 777 อัปโหลดไม่ได้ ก็น่าจะพบพรื่ด ๆ นะครับ
Date :
2012-08-27 03:20:00
By :
deawx
Load balance : Server 01