|
 |
|
เกี่ยวกับการอัพโหลดไฟล์ทีละหลายไฟล์ครับ คือผมต้องการอัพโหลดรูปครับทีละ5 รูป แต่มันมันมีปัญหา |
|
 |
|
|
 |
 |
|
<?php
for($i=0;$i<count($_FILES["upload_image"]["name"]);$i++) //แบบนี้มั้ง
if(copy($_FILES["upload_image"]["tmp_name"][$i],"image/image_event/".$_FILES["upload_image"]["name"][$i])) //แบบนี้ด้วยมั้งCode (PHP)
?>
|
 |
 |
 |
 |
Date :
2009-05-24 01:53:13 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PageMultiFiles1.html)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<form name="form1" method="post" action="PageMultiFiles2.php" enctype="multipart/form-data">
<input type="file" name="filUpload[]"><br>
<input type="file" name="filUpload[]"><br>
<input type="file" name="filUpload[]"><br>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
for($i=0;$i<count($_FILES["filUpload"]["name"]);$i++)
{
if($_FILES["filUpload"]["name"][$i] != "")
{
if(copy($_FILES["filUpload"]["tmp_name"][$i],"myfile/".$_FILES["filUpload"]["name"][$i]))
{
echo "Copy/Upload Complete<br>";
}
}
}
?>
</body>
</html>
Ref : PHP Multiple File Field Upload
|
 |
 |
 |
 |
Date :
2009-05-24 06:52:08 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันก็ไม่ได้เหมือนเดิมครับ เขียนเหมือนกันครับ
|
 |
 |
 |
 |
Date :
2009-05-24 10:35:20 |
By :
taknaja |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เว้นวรรค ผลลัพท์ก็เหมือนเดิมครับ คือ ถ้าเกิดเราต้องการอัพ 5 รูป มันจะไม่มีอะไรเกิดขึ้นครับ
พออัพ 2 รูป มันก็มาแค่รูปเดียวรูป ที่ 1 มันไม่มา ทุก ๆ ครั้งที่อัพรูปที่ 1 มันจะไม่มาครับ
|
 |
 |
 |
 |
Date :
2009-05-24 10:44:34 |
By :
taknaja |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองดูตัวอย่างที่ผมให้ดูน่ะครับ มันใช้งานได้ครับ
|
 |
 |
 |
 |
Date :
2009-05-24 10:47:34 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เหมือนเดิมครับ
|
 |
 |
 |
 |
Date :
2009-05-24 10:55:26 |
By :
taknaja |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รู้แล้วครับว่ามันเป็นที่อะไร โค๊ดมันถูกแล้วครับ แต่ผิด ก็คือ ที่ ไฟล์ php.ini มันต้องไปแก้ตรง
upload ครับ ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2009-05-24 11:23:22 |
By :
taknaja |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|