aspupload

igartzi
03 de Marzo del 2006
Hola al foro!!
estoy creando una aplicacin de inmobiliarias, con 3 opciones en la maquinaria, insertar, modificar y borrar. Insertar y borrar me funciona correctamente, pero modificar no lo consigo.

el cdigo que tengo ahora es:

<%

Set Upload = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Upload\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")

Path2 = Server.MapPath(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"../images/venta/fotosg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")

Path3 = Server.MapPath(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"../images/venta/fotos\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")

Path =Server.MapPath(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"../images/fotos\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")




count = Upload.Save(Path)

If count = 0 Then
Response.Write \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Falta alguna imagen por insertar.\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
Response.End
else
If count = 1 Then
Response.Write \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Falta alguna imagen por insertar.\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
Response.End
Else
If count = 2 Then
Response.Write \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Falta alguna imagen por insertar.\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
Response.End
Else




Set File1 = Upload.Files(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"imagen1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Set File2 = Upload.Files(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"imagen2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Set File3 = Upload.Files(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"imagen3\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")


Set jpeg1 = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Jpeg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Set jpeg2 = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Jpeg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Set jpeg3 = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Jpeg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")

Set jpeg4 = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Jpeg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Set jpeg5 = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Jpeg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Set jpeg6 = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Persits.Jpeg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")


jpeg1.Open( File1.Path )
jpeg2.Open( File2.Path )
jpeg3.Open( File3.Path )

jpeg4.Open( File1.Path )
jpeg5.Open( File2.Path )
jpeg6.Open( File3.Path )


Jpeg1.Width = Jpeg1.OriginalWidth / 2
Jpeg1.Height = Jpeg1.OriginalHeight / 2

Jpeg2.Width = Jpeg2.OriginalWidth / 2
Jpeg2.Height = Jpeg2.OriginalHeight / 2

Jpeg3.Width = Jpeg3.OriginalWidth / 2
Jpeg3.Height = Jpeg3.OriginalHeight / 2

Jpeg4.Width = Jpeg4.OriginalWidth / 4
Jpeg4.Height = Jpeg4.OriginalHeight / 4

Jpeg5.Width = Jpeg5.OriginalWidth / 4
Jpeg5.Height = Jpeg5.OriginalHeight / 4

Jpeg6.Width = Jpeg6.OriginalWidth / 4
Jpeg6.Height = Jpeg6.OriginalHeight / 4


SavePath1 = Path2 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File1.ExtractFileName
SavePath2 = Path2 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File2.ExtractFileName
SavePath3 = Path2 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File3.ExtractFileName

SavePath4 = Path3 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File1.ExtractFileName
SavePath5 = Path3 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File2.ExtractFileName
SavePath6 = Path3 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File3.ExtractFileName


If UCase(Right(SavePath1, 3)) <> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"JPG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" Then
SavePath1 = SavePath1 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".jpg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
End If

If UCase(Right(SavePath2, 3)) <> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"JPG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" Then
SavePath2 = SavePath2 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".jpg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
End If

If UCase(Right(SavePath3, 3)) <> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"JPG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" Then
SavePath3 = SavePath3 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".jpg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
End If

If UCase(Right(SavePath4, 3)) <> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"JPG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" Then
SavePath4 = SavePath4 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".jpg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
End If

If UCase(Right(SavePath5, 3)) <> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"JPG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" Then
SavePath5 = SavePath5 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".jpg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
End If

If UCase(Right(SavePath6, 3)) <> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"JPG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" Then
SavePath6 = SavePath6 & \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".jpg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"


end if


jpeg1.Save SavePath1
jpeg2.Save SavePath2
jpeg3.Save SavePath3
jpeg4.Save SavePath4
jpeg5.Save SavePath5
jpeg6.Save SavePath6


%>

<%

Set fs = Server.CreateObject(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Scripting.FileSystemObject\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")



if fs.FileExists(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\xvrt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\servre-inmobiliaria.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\maqueta/images/fotos/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File1.Filename) then fs.DeleteFile(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\xvrt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\servre-inmobiliaria.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\maqueta/images/fotos/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File1.Filename)

if fs.FileExists(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\xvrt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\servre-inmobiliaria.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\maqueta/images/fotos/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File2.Filename) then fs.DeleteFile(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\xvrt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\servre-inmobiliaria.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\maqueta/images/fotos/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File2.Filename)

if fs.FileExists(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\xvrt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\servre-inmobiliaria.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\maqueta/images/fotos/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File3.Filename) then fs.DeleteFile(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\xvrt\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\servre-inmobiliaria.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\html\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\maqueta/images/fotos/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & File3.Filename)

Set fs = Nothing
%>

Este cdigo me funciona bien simpre y cuando los campos imagen 1, imagen2, imagen 3 esten seleccionados, lo que quiero es que si el usuario no selecciona nada se quede con la imagen actual ya que no siempre querra modificar todas las imagenes.

Un saludo.
Espero que me puedan ayudar.