ASP.NET FSO Copyfile method?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngfreeforall' list.


Damian Barrow
There was no copyfile method in FSO (there was move, but no copy).
Is there something now in the new improved FSO.NET?=20

I'm currently creating a folder based upon a users database name and
then their page runs based upon the folder name.

All I want to do is copy the template file tc_template.aspx to the newly
created folder... How can I do that?

I really don't fancy writelining 800 lines of code.

Cheers
Damian

Reply to this message...
 
    
Yossi Dahan
The File class has a static method called copy which copies a file from
folder a to folder b.

-----Original Message-----
From: Damian Barrow [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 11:13 AM
To: aspngfreeforall
Subject: [aspngfreeforall] ASP.NET FSO Copyfile method??

There was no copyfile method in FSO (there was move, but no copy).
Is there something now in the new improved FSO.NET?

I'm currently creating a folder based upon a users database name and
then their page runs based upon the folder name.

All I want to do is copy the template file tc_template.aspx to the newly
created folder... How can I do that?

I really don't fancy writelining 800 lines of code.

Cheers
Damian

| ASP.net DOCS = http://www.aspng.com/docs
| [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/aspngfreeforall = JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP

Reply to this message...
 
    
Beattie, Barry
Damien:

there IS a copy in asp classic FSO...

<%
Dim fso, theCopy 'make a file object
Set fso = Server.CreateObject("Scripting.FileSystemObject")
dim yourFile: yourFile = "lightbulbs.html"
dim overwrite: overwrite = true

path_in = server.mappath("/barry/download") & "\lightbulbs2.txt"
path_out = server.mappath(yourFile)

if fso.FileExists(path_in) then '-- a bit of error checking
Set theCopy = fso.GetFile(path_in)
call theCopy.Copy(path_out, overwrite) '---------------- see?
else
strError = "Error - Source file does not exist"
end if

Set theCopy = nothing
Set fso = Nothing

if err.number > 0 then
response.write err.number & "<br>"
response.write err.description & "<br>"
else
response.write "<a href=" & yourFile & ">" _
& " click here to view your file </a>"
end if
%>

-----Original Message-----
From: Yossi Dahan [mailto:Click here to reveal e-mail address]
Sent: Thursday, 15 August 2002 8:29 PM
To: aspngfreeforall
Subject: [aspngfreeforall] RE: ASP.NET FSO Copyfile method??

The File class has a static method called copy which copies a file from
folder a to folder b.

-----Original Message-----
From: Damian Barrow [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 15, 2002 11:13 AM
To: aspngfreeforall
Subject: [aspngfreeforall] ASP.NET FSO Copyfile method??

There was no copyfile method in FSO (there was move, but no copy).
Is there something now in the new improved FSO.NET?

I'm currently creating a folder based upon a users database name and
then their page runs based upon the folder name.

All I want to do is copy the template file tc_template.aspx to the newly
created folder... How can I do that?

I really don't fancy writelining 800 lines of code.

Cheers
Damian

| ASP.net DOCS = http://www.aspng.com/docs
| [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/aspngfreeforall = JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP

| ASP.net DOCS = http://www.aspng.com/docs
| [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/aspngfreeforall = JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com