On my asp.net page, I make a copy of the file from my local drive to the server.
'append the name to the id number and generate the file name
strFileName = System.Configuration.ConfigurationManager.AppSettings("strAttachmentsPath") & l.ToString & "_" & CType(Session("FileName"), String)
'upload the file
'FileUpload1.SaveAs(strFileName)
System.IO.File.Copy(CType(Session("Attachment"), String), strFileName, True)
strFileNamecontains the server path, for example "\\myServer\images\theNewFileName.jpg"
Session("Attachment")contains my local path'C:\Users\myUser\Desktop\AccountsFrance.txt'
But when I run this code, asp.net throws an exception:
But I can easily go to this file .... I do not understand why this is happening: (

source
share