2011-02-02 126 views
0

我有以下形式:PHP上傳文件腳本在ASP transcipted

<form enctype="multipart/form-data" action="uploader.php" method="POST"> 
<input type="hidden" name="MAX_FILE_SIZE" value="100000" /> 
Choose a file to upload: <input name="uploadedfile" type="file" /><br /> 
<input type="submit" value="Upload File" /> 
</form> 

爲uploader.php,該文件被上傳,這裏是代碼:

$target_path = "uploads/"; 
$target_path = $target_path . basename($HTTP_POST_FILES['uploadedfile']['name']); 
if(copy($HTTP_POST_FILES['uploadedfile']['tmp_name'], $target_path)) { 
    echo "The file ". basename($_FILES['uploadedfile']['name']). 
    " has been uploaded"; 
} else{ 
    echo "There was an error uploading the file, please try again!"; 
} 

正如我打算將此代碼移動到IIS,您能否幫助重寫uploader.php代碼將其轉換爲asp,以便我可以將操作更改爲'uploader.asp'? 如果這是不可能的,我該如何使用網絡服務來做到這一點?

謝謝

問候

+0

[用戶刪除的文字] – horatio 2011-02-02 18:40:06

回答

1

不知道,如果你嘗試過,甚至尋找ASP相關 '的形式/上傳' 內容..很容易發現:

http://www.asp101.com/resources/aspupload.asp

<HTML> 
<BODY> 
<% 
Set Upload = Server.CreateObject("Persits.Upload.1") 
Count = Upload.Save("c:\upload") 
%> 
<% = Count %> files uploaded. 
</BODY> 
</HTML> 

這是一個簡單的上傳表單,大量的例子。檢查鏈接做一個搜索以及參考,SO不適合有人爲你工作。這是爲了解答你所困擾的問題/問題。