Home
Developer Blog
Ajax effects
CSS examples
Freelance jobs
Hot IT Jobs
Hot scripts
Code samples
Web hosting directory
Lotus Notes FAQ
See the new scripts recently added to Dynamic Drive.
Click here
.
Original, practical
CSS codes and examples
such as CSS menus for your site.
Search code samples
Keyword
All Categories
ASP
CSS
Dhtml
Html
Javascript
PHP
Code Samples
ASP
CSS
Dhtml
Html
Javascript
PHP
LOGIN HERE
Username
Password
Signup Now
Forgot Password
Verify Signup
ASP >> General
How can I copy a file using ASP?
Visitor Ratings (0) :
Description
You can copy a file in ASP using the Scripting.FileSystemObject which is built into the Windows scripting engine. In the following you can use CopyFile() function to copy a file.
Code
Select All
function CopyFile(strFileSource, strFileDestination, strError) if strFileSource = "" OR strFileDestination = "" then strError = "Error - You must supply both a source and a destination" exit function end if set fso = Server.CreateObject("Scripting.FileSystemObject") if Not fso.FileExists(strFileSource) then strError = "Error - Source file does not exist" exit function end if if strError = "" then Set f2 = fso.GetFile(strFileSource) f2.Copy(strFileDestination) Set f2 = nothing end if Set fso = nothing end function
Rate this Resource
0
1
2
3
4
5
6
7
8
9
10