"kathy30" <ka*********@yahoo.comwrote in message
news:83**********************************@u69g2000 hse.googlegroups.com...
I'm storing files in SQL and retrieving them when needed to the user's
C: Drive
This is accessed on our Intranet site, the problem is the create
directory and saving files happens on the Server not the User's PC
Here is the code
System.IO.Directory.CreateDirectory("C:
\" & fDIR)
Dim fs As New FileStream("c:\" & fDIR & "\" &
filename, FileMode.CreateNew, FileAccess.Write)
Any help would be great
You need to set up a UNC path for the user computer:
Dim temp As String = "\\" & Get_IPAddress() & "\C$\"
UNCPath = Application.StartupPath.Replace("C:\", temp)
'----------------------------------------------------------------------
Private Function Get_IPAddress() As String
Dim temp As String = String.Empty
Try
Dim strHostName As String = String.Empty
strHostName = System.Net.Dns.GetHostName()
temp = System.Net.Dns.GetHostEntry(strHostName).AddressLi st(0).ToString()
Catch : End Try
Return temp
End Function