Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Upload

Author  Topic 

vk18
Posting Yak Master

146 Posts

Posted - 2007-01-26 : 12:31:56
Hi Guys,

I need to browse 10 text files, When i browse the text file i need to put that file name in the list box. I am using VB.NET/ASP.NET and Sql Server2000.
How can i do this.? can you help me.
Thx

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-26 : 13:41:02
Is the DIR function deprecated?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-01-26 : 13:45:18
NO, i just need to dislplay the files in the list box just to let user know what are the files he selected. no need to save in the database. once he clears the screen it will go away.
thx

quote:
Originally posted by Peso

Is the DIR function deprecated?


Peter Larsson
Helsingborg, Sweden

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-26 : 15:24:11
DIR function returns a long string with file names matches current filter.
Use the JOIN function to get an array from the string and iterate the array.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-01-26 : 15:34:15
Hi,
I wrote this code just to browse the file. can you help me after this.
Thx

Dim savePath As String = UPLOAD_FILE_PATH & "\"

Dim myIdentity As WindowsIdentity
myIdentity = WindowsIdentity.GetCurrent()
Dim myPrincipal As New WindowsPrincipal(myIdentity)
Dim SetFileName As String

If Not (uploadedFile.PostedFile Is Nothing) Then


Dim postedFile = uploadedFile.PostedFile
Dim filename As String = Path.GetFileName(postedFile.FileName)
Dim contentType As String = postedFile.ContentType
Dim contentLength As Integer = postedFile.ContentLength

Dim newFileName As String = Today.Now.ToString()
newFileName = Replace(newFileName, "/", "")
newFileName = Replace(newFileName, ":", "")
newFileName = Replace(newFileName, " ", "")

SetFileName = savePath & newFileName & "_" & filename

'''UPLOAD TO SERVER'''
postedFile.SaveAs(SetFileName)
''''''''''''''''''''''
End If




quote:
Originally posted by Peso

DIR function returns a long string with file names matches current filter.
Use the JOIN function to get an array from the string and iterate the array.


Peter Larsson
Helsingborg, Sweden

Go to Top of Page
   

- Advertisement -