User696431485 posted
Hi
I'm trying to copy some files from my local machine onto the server.
I use this code -
Dim DocumentsSourcePath As String = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings("DocumentsPath").ToString(), AppId)
Dim dir As DirectoryInfo = New DirectoryInfo(Server.MapPath(DocumentsSourcePath))
Dim DocumentsSourcePath As String = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings("DocumentsPath").ToString(), AppId)
Dim dir As DirectoryInfo = New DirectoryInfo(Server.MapPath(DocumentsSourcePath))
Dim f As FileInfo
If Directory.Exists(DocumentsSourcePath) Then
For Each f In dir.GetFiles()
f.CopyTo(VirtualPath, True)
Next
End If
VirtualPath is something like \\remoteserver\folder1\folder2\folder3\
DocumentsSourcePath is a folder in the root dir of the application.
The error I get is --
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
What am I doing wrong?