Hi All
I want to use ASP to copy a file from one folder to another.
I am using the following code but it gives me a file not found error on the
destination file name. All is want is
1. The user chooses the name of the template from a dropdown.
2. I want to take the template file that the user has choosen
3. Give it a newname ie. strContractId & strTemplateName
4. Copy the file to a new folder with the new name.
<%
strTemplateName = request.form("c ontemplate")
strContractId = request.form("c ontractId")
strfileName = strTemplateName
strDestFileName = strContractId & strTemplateName
strOrgPath = "c:\InetPub\www root\mypro\temp lates\" & strFilename
strDestinationP ath = "c:\myusername\ " & strDestFileName
' * * * it works if I explicity define the file name like it works but if i
want to create the destination file using the variable like the line above
it fails.
' What is that I am doing wrong.
strDestinationP ath = "c:\" & "metext.txt "
' Example code 1
Dim objFSO
Set objFSO = CreateObject("S cripting.FileSy stemObject")
objFSO.CopyFile strOrgPath, strDestinationP ath
' Example code 2
set fs=Server.Creat eObject("Script ing.FileSystemO bject")
set f=fs.GetFile(st rOrgPath )
f.Copy strDestinationP ath ,false
set f=nothing
set fs=nothing
%>