Copy file with a name change

Thread Solved

Join Date: Jul 2006
Posts: 11
Reputation: AndrewSmith is an unknown quantity at this point 
Solved Threads: 0
AndrewSmith AndrewSmith is offline Offline
Newbie Poster

Copy file with a name change

 
0
  #1
Aug 11th, 2006
ola

I need to copy a file from one directory on my server to another. The thing is, if the file already exists in the destination folder, I need to copy it with a different name (i'd just like to add a 2 or something to the end of the fileName).

Is there any way to copy a file AND change the name?
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 11
Reputation: AndrewSmith is an unknown quantity at this point 
Solved Threads: 0
AndrewSmith AndrewSmith is offline Offline
Newbie Poster

Re: Copy file with a name change

 
0
  #2
Aug 11th, 2006
Alright, I solved it. Turns out you can just put the name of the file right there in the copyFile line.
looks like this:

  1. fs.CopyFile sourceFile, DestinationFolder & "\NEWFILENAME.txt", 1

Next time i'll look around a bit more before posting.
Rock on.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 26
Reputation: chmonalisa is an unknown quantity at this point 
Solved Threads: 1
chmonalisa chmonalisa is offline Offline
Light Poster

Re: Copy file with a name change

 
0
  #3
Sep 13th, 2006
hey andrew,

Try this,


save the file name with a unique no.

and the unique no. is

day() & month() & year() & hour() & min() & second()

thanks,
Chaitanya.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 4845 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC