2009-11-11 273 views
0

我正在尋找一個解決方案,從瀏覽器上傳多個文件到服務器。截至目前,HTML頁面是用oracle HTTP工具包編寫的(在Windows NT上使用oracle mod_plsql)。發送文件在http(從客戶端存儲在服務器上傳)

有人可以建議我解決方案來從客戶端上傳文件並在服務器中處理它。基於HTML,Oracle HTTP,PHP的解決方案都很好。鏈接和建議非常感謝。

+0

搜索「php multiple upload」,這裏有很多類似(回答)的問題,關於SO – Piskvor 2009-11-11 10:15:57

回答

1

你可以使用類似的東西,但我會建議添加更多的驗證。

<?php 


switch ($_REQUEST['mode'] 

    case 'upload': 

     $ourpath = "/ourfolder/uploads/"; 

     $target_path = $target_path . basename($_FILES['uploadedfile']['name']); 

     if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { 
      echo "You have uploaded". basename($_FILES['uploadedfile']['name']); 
     } else{ 
      echo "There was an error uploading the file, please try again!"; 
     } 

     break; 

    default: 

    ?><form enctype="multipart/form-data" method="POST"> 
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> 
    Select a File: <input name="uploadedfile" type="file" /><br /> 
    <input type="hidden" name="mode" value="upload" /> 
    <input type="submit" value="Submit" /> 
    </form> 

<?php 

} 

?> 
相關問題