2011-09-07 377 views
1

我試圖上傳文件到我的服務器。該文件正在上傳,但我想獲得File1文本框中的值。我不想要路徑,我只想要保存的文件名。經典ASP獲取文本框的值 - 使用VBScript

<html> 
    <head> 
    <title>File Upload</title> 
    </head> 
<body> 
    <form name="uploadr" method="post" action="" enctype="multipart/form-data"> 
     File 1 : <input name="File1" type="file"/><br/><br/> 
       <input name="btnSubmit" type="submit" value="Upload files &gt;&gt;" /><br/> 
       <input name="hiddenVal" type="hidden" value="testVal" /> 
    </form> 
</body> 
</html> 

我有下面的VBScript:

<% 
    Server.ScriptTimeout = 2000 
    Form.SizeLimit = &H100000 

    If Form.State = 0 Then 'Completed 
     Form.Files.Save DestinationPath 
     response.write "<br><Font Color=green>File (" & Form.TotalBytes \1024 & "kB) was saved to " & DestinationPath & " folder.</Font>" 
     response.write(document.uploadr.hiddenVal.value()) 
    ElseIf Form.State > 10 then 
     Const fsSizeLimit = &HD 
     Select case Form.State 
      case fsSizeLimit: response.write "<br><Font Color=red>Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)</Font><br>" 
      case else response.write "<br><Font Color=red>Some form error.</Font><br>" 
     end Select 
    End If'Form.State = 0 then 

%> 

當它到達response.write(document.uploadr.hiddenVal.value())它說 '文件' 變量未定義。

我需要做些什麼來獲得文本框的值?

回答

1

試試這個:

response.write(UploadFormRequest("hiddenVal"))