file upload control
how i get the file name from dynamically generated file upload control
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sai babuPosted Oct 12, 2007, 6:39 AM
try the following code u will get a file name
Dim Files As HttpFileCollection
Dim intCount as integer
Dim arrCount() As String
Files = Request.Files
arrCount = Files.AllKeys ' This will get names of all files into a string array.
For intCount = 0 To arrCount.GetUpperBound(0)
If arrCount(intCount).StartsWith("fuAttachment") Then 'Filter for certain file upload control id to be saved
'Save file
Files(arrCount(intCount)).SaveAs(strPath & System.IO.Path.GetFileName(FormatFileName(Files(arrCount(intCount)).FileName)))
End If
Next