2
A
回答
3
0
+1
感謝您的輸入 - 我試過FancyUpload,但它似乎很複雜,很少或根本不支持論壇行動 – 2009-09-29 15:38:21
+0
那麼SWFUpload呢?一樣? – MaxiWheat 2009-09-29 16:40:23
0
我的plupload支持各種各樣的另外的客戶端技術(HTML5,閃光燈,Silverlight中,的BrowserPlus,齒輪)的風扇以基本的單個文件html4上傳,不像SWFUpload只有flash + html4後備。
它也很好地與jQuery的整合。
1
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form action="multiple_upload_ac.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td><strong>multiple Files Upload </strong></td>
</tr>
<tr>
<td>Select file
<input name="ufile[]" type="file" id="ufile[]" size="50" /></td>
</tr>
<tr>
<td>Select file
<input name="ufile[]" type="file" id="ufile[]" size="50" /></td>
</tr>
<tr>
<td>Select file
<input name="ufile[]" type="file" id="ufile[]" size="50" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit" value="Upload" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
STEP2:創建文件multiple_upload_ac.php
<?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path1= "upload/".$HTTP_POST_FILES['ufile']['name'][0];
$path2= "upload/".$HTTP_POST_FILES['ufile']['name'][1];
$path3= "upload/".$HTTP_POST_FILES['ufile']['name'][2];
//copy file to where you want to store file
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2);
copy($HTTP_POST_FILES['ufile']['tmp_name'][2], $path3);
//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][0]."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][0]."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][0]."<BR/>";
echo "<img src=\"$path1\" width=\"150\" height=\"150\">";
echo "<P>";
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][1]."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][1]."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][1]."<BR/>";
echo "<img src=\"$path2\" width=\"150\" height=\"150\">";
echo "<P>";
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][2]."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][2]."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][2]."<BR/>";
echo "<img src=\"$path3\" width=\"150\" height=\"150\">";
///////////////////////////////////////////////////////
// Use this code to display the error or success.
$filesize1=$HTTP_POST_FILES['ufile']['size'][0];
$filesize2=$HTTP_POST_FILES['ufile']['size'][1];
$filesize3=$HTTP_POST_FILES['ufile']['size'][2];
if($filesize1 && $filesize2 && $filesize3 != 0)
{
echo "We have recieved your files";
}
else {
echo "ERROR.....";
}
//////////////////////////////////////////////
// What files that have a problem? (if found)
if($filesize1==0) {
echo "There're something error in your first file";
echo "<BR />";
}
if($filesize2==0) {
echo "There're something error in your second file";
echo "<BR />";
}
if($filesize3==0) {
echo "There're something error in your third file";
echo "<BR />";
}
?>
I found this code in http://www.phpeasystep.com/phptu/2.html
for more details check <a href="http://www.specialend.com/">Tutorial</a>
相關問題
- 1. 用php腳本上傳多個文件
- 2. PHP文件上傳腳本不上傳文件
- 3. 安全的PHP文件上傳腳本
- 4. 錯誤上傳文件thorugh PHP腳本
- 5. php腳本文件沒有上傳
- 6. PHP:文件上傳腳本和move_upload_file
- 7. PHP腳本將文件上傳到FTP
- 8. PHP上傳文件腳本在ASP transcipted
- 9. PHP文件上傳腳本失敗
- 10. Php OOps文件上傳工作腳本
- 11. 多個文件上傳Google Apps腳本
- 12. 多文件上傳腳本不工作在php
- 13. PHP多文件上傳腳本無法正常工作
- 14. 使用PHP腳本和iOS上傳多個文件
- 15. 支持多種文件PHP腳本上傳
- 16. PHP上傳腳本
- 17. php上傳腳本
- 18. bash腳本上傳文件
- 19. php多圖像上傳腳本不會上傳一些圖像文件
- 20. PHP上傳腳本不會上傳Flash文件。爲什麼?
- 21. 如何:上傳文本文件,並與PHP腳本中使用
- 22. PHP上傳:上傳多個文件?
- 23. 用PHP多文件上傳
- 24. 上傳多個文件PHP
- 25. php/jquery多文件上傳
- 26. PHP多文件上傳infineite
- 27. PHP MySQL多文件上傳
- 28. 多文件上傳PHP
- 29. PHP多個文件上傳
- 30. FTP多文件上傳PHP
@Adam - 這似乎是http://stackoverflow.com/questions/159600/multiple-file-upload的副本,其中有幾個很好的答案。的 – 2009-09-29 15:23:56
可能重複[PHP多文件上傳(http://stackoverflow.com/questions/14542068/php-multiple-file-uploads) – e4c5 2015-08-28 05:21:54
這可能是最常見的所有問題上的計算器 – e4c5 2015-08-28 05:22:09