Hi All
I am trying to use copy file to upload some files. If I copy from C:\Windows, the copy works. But if I try from a folder called C:\Joda, It doesn't. This is some simple test code I have setup.
When I run this, I get the following results
Before you ask, I have double, triple, 10 times checked the folder and file do exist. I have also checked on another PC.
Any one any ideas PLEASE.
I am trying to use copy file to upload some files. If I copy from C:\Windows, the copy works. But if I try from a folder called C:\Joda, It doesn't. This is some simple test code I have setup.
Code:
<%
dim SourceFile, DestFile, DBconn, fs, fo
Set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder(Server.MapPath("images"))
response.write fo & "<br>"
if fs.driveexists("c:") = true then
Response.Write("Drive c: exists.")&"<br>"
Else
Response.Write("Drive c: does not exist.")&"<br>"
End If
If fs.FolderExists("c:\WINDOWS") = true Then
Response.Write("Folder c:\windows exists.")&"<br>"
Else
Response.Write("Folder c:\WINDOWS does not exist.")&"<br>"
End If
If fs.FileExists("C:\WINDOWS\win.ini") = true Then
Response.Write("File C:\WINDOWS\win.ini exists.")&"<br>"
Else
Response.Write("File C:\WINDOWS\win.ini does not exist.")&"<br>"
End If
SourceFile = "C:\windows\win.ini"
DestFile = Fo & "\"
fs.CopyFile SourceFile, Fo&"\", true
If fs.FolderExists("c:\Joda") = true Then
Response.Write("Folder c:\Joda exists.")&"<br>"
Else
Response.Write("Folder c:\Joda does not exist.")&"<br>"
End If
If fs.FileExists("C:\Joda\test.txt") = true Then
Response.Write("File C:\Joda\test.txt exists.")&"<br>"
Else
Response.Write("File C:\Joda\test.txt does not exist.")&"<br>"
End If
SourceFile = "C:\Joda\test.txt"
DestFile = Fo & "\"
fs.CopyFile SourceFile, Fo&"\", true
set fs=nothing
%>
Code:
Drive c: exists.
Folder c:\windows exists.
File C:\WINDOWS\win.ini exists.
Folder c:\Joda does not exist.
File C:\Joda\test.txt does not exist.
Microsoft VBScript runtime error '800a004c'
Path not found
/Joda/Do_Upload.asp, line 58
Any one any ideas PLEASE.