|
 |
|
การอัพโหลดไฟล์ระ ช่วยหน่อย พอดีว่า ตอนอัพในเครื่องนะอัพได้ แต่พออัพหน้าเว็บขึ้นเซิฟเวอร์ แล้วมันเข้า |
|
 |
|
|
 |
 |
|
<form method=post action="addupload.php" enctype="multipart/form-data">
<input name="tname" type="text" id="tname" />
<input type="file" name="qfile" size=45>
<input type=submit value=อัพโหลด name=submit>
</form>
|
 |
 |
 |
 |
Date :
2009-08-14 16:34:38 |
By :
นัท |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?
include("config.inc.php");
$tname =$_POST["tname"];
$file=$_FILES['file'];
$place="fileupload"; //ระบุตำแหน่งที่เก็บไฟล์
echo $file[name];
if(@copy($file[tmp_name],"$place/".$file[name]))
{
$path = "fileupload/".$file[name];
$date =date("d/m/Y");
$sql_insert="insert into meeting(mt_name, mt_date, path) values ('$tname', '$date', '$path')";
$result= mysql_query( $sql_insert, $conn );
echo "<script language='JavaScript'>";
echo "alert('อัพโหลดเรียบร้อยแล้ว');";
echo "window.navigate('evaluate.php');";
echo "</script>";
}
else{
echo "ไม่สามารถอัพโหลดได้";
}
?>
|
 |
 |
 |
 |
Date :
2009-08-14 16:36:00 |
By :
นัท |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
if (copy($picture,"$picture_path/$picture_name_new")) {
?>
|
 |
 |
 |
 |
Date :
2009-08-14 16:47:11 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ที่ไม่สามารถอัพโหลดไฟล์ได้ ไม่ทราบเหมือนกันว่าคุณได้มีการตั้งสิทธิ์ในโฟล์เดอร์ที่จะรูปเข้าไปแล้วหรือยังครับ ปกติโฮสต์ที่เราใช้จะต้องดูส่วนนี้ด้วยนะครับ
แต่ก็ลองให้มันแสดง error ออกมา จะได้เห็นว่ามีการผิดพลาดตรงส่วนไหน เช่น permission อะไรทำนองนี้นะครับ
|
 |
 |
 |
 |
Date :
2009-08-14 16:47:50 |
By :
riderman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$file=$_FILES['file']; and <input type="file" name="qfile" size=45>
แปลกนะที่เครื่องอัพได้ไง
|
 |
 |
 |
 |
Date :
2009-08-14 20:38:16 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำเอาตลก
|
 |
 |
 |
 |
Date :
2009-08-14 21:47:55 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<input type="file" name="qfile" size=45>
$file=$_FILES['qfile'];
ข้างบน ค็อปตัวผิดมานะ พอดีลองแก้หลายรอบ ลองเปลี่ยนชื่อดูนะ ลืมดู
|
 |
 |
 |
 |
Date :
2009-08-14 23:21:18 |
By :
นัท |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|