Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/02/2002, 12:33
Avatar de Ruchu
Ruchu
 
Fecha de Ingreso: octubre-2001
Mensajes: 698
Antigüedad: 23 años, 7 meses
Puntos: 2
Re: FileSystemObject

si el fichero es de texto asi se crean y se sobreescriben:

Set Mfso=Server.CreateObject("Scripting.FileSyste mObject")
Set MArchivo=Mfso.OpenTextFile(Server.Mappath("mi fichero.txt"),2,true)
MArchivo.write "hola" MArchivo.Close
Set MArchivo=Nothing
Set Mfso=Nothing


y si el fichero no es de texto entonces se copian y tambien se machacan con el mismo codigo:

Set FS = Server.CreateObject("Scripting.FileSystemObje ct")
FS.CopyFile Server.Mappath("../ilustraciones/f1.jpg"), Server.Mappath("f2"),True
Set FS=Nothing


pero cuidado que solo se machacan si el fichero no tiene atributos de solo lectura.