how to save a file to a different server

October 20, 2011 at 15:37:58
Specs: Windows 7
my web and sql db are on different servers. I know how to create a directory and save files on my web server but what would be the syntax for creating a directory on a different server? Now I have:
Dim DirToCreate As String = "c:\BulkEmailAttachments\" & UserName & "_" & Session("UserID") & "\" & "ProfileID_" & Session("LastProfileID")
Dim di As DirectoryInfo = New DirectoryInfo(DirToCreate)
If di.Exists Then 'user already has created an attachment
'not sure we need to do anything here
Else
di.Create()
End If
I want something like:
Dim DirToCreate As String = "\\databaseservername\c:\BulkEmailAttachments\" & UserName & "_" & Session("UserID") & "\" & "ProfileID_" & Session("LastProfileID")

See More: how to save a file to a different server

Report •

#1
October 23, 2011 at 16:32:06
Options:
1) Make a share on the other server, give your ASP account write access. (Potential security issue.)
2) Schedule a task every X minutes to scan a local location, and move any files to the remote location. (More complex.)
3) I think SQL Server's new FILESTREAM might work, but I haven't really looked into that feature.

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question