Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/06/2008, 14:23
haga41
 
Fecha de Ingreso: junio-2008
Mensajes: 145
Antigüedad: 16 años, 10 meses
Puntos: 0
Respuesta: ¿Cómo puedo meter variable un fichero en la orden Server.CreateObject?

Gracias por la ayuda Shiryu_Libra, lo he adaptado como me dices tú pero he debido hacer algo mal porque pone el siguiente error:

Error de compilación de Microsoft VBScript (0x800A0412)
Debe ser la primera instrucción de la línea
/Miweb/Eliminarportada.asp, línea 28, columna 33
fs.DeleteFile(carpeta & fichero) end if
--------------------------------^

Este es el código:

Carpeta = server.mappath("C:/Inetpub/wwwroot/MiWeb/imagenes/")
dim fichero
fichero = tabla.fields("imagen")
dim fs
Set fs=Server.CreateObject("Scripting.FileSystemObject ")
if fs.FileExists(carpeta & fichero) then
fs.DeleteFile(carpeta & fichero) end if
set fs=nothing