Copying files using ASP

Results 1 to 2 of 2

Thread: Copying files using ASP

  1. #1
    Join Date
    Dec 1969

    Default Copying files using ASP

    Is it possible to copy a file (using the FSO or whatever) from one folder to another using an ASP page?<BR>If so, can someone point me in the right direction?

  2. #2
    Join Date
    Dec 1969

    Default RE: Copying files using ASP

    Sub ManipFiles<BR> Dim fso, f1, f2, s<BR> Set fso = CreateObject("Scripting.FileSystemObject")<BR> Set f1 = fso.CreateTextFile("c: estfile.txt", True)<BR> Response.Write "Writing file <BR>"<BR> &#039; Write a line.<BR> f1.Write ("This is a test.")<BR> &#039; Close the file to writing.<BR> f1.Close<BR> Response.Write "Moving file to c: mp <BR>"<BR> &#039; Get a handle to the file in root of C:.<BR> Set f2 = fso.GetFile("c: estfile.txt")<BR> &#039; Move the file to mp directory.<BR> f2.Move ("c: mp estfile.txt")<BR> Response.Write "Copying file to c: emp <BR>"<BR> &#039; Copy the file to emp.<BR> f2.Copy ("c: emp estfile.txt")<BR> Response.Write "Deleting files <BR>"<BR> &#039; Get handles to files&#039; current location.<BR> Set f2 = fso.GetFile("c: mp estfile.txt")<BR> Set f3 = fso.GetFile("c: emp estfile.txt")<BR> &#039; Delete the files.<BR> f2.Delete<BR> f3.Delete<BR> Response.Write "All done!"<BR>End Sub<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts