Ver Mensaje Individual
  #9 (permalink)  
Antiguo 15/05/2005, 04:57
rrtsilva
 
Fecha de Ingreso: mayo-2005
Ubicación: Santiago
Mensajes: 10
Antigüedad: 19 años, 11 meses
Puntos: 0
Cita:
Iniciado por trasgukabi
pues nada, si tienes el código listo para la asociación de una imagen, tan sólo tienes que crear otro campo en la base de datos y asociar la segunda imagen (al menos eso ha sido lo que he entendido). Espero que los campos los hagas de tipo texto, que en el campo insertes sólo el nombre de la imagen y que, al desplegar esas imágenes, lo hagas así:

<img src="<%=rscordset("imagengif")%>">
<img src="<%=rscordset("imagenjpg")%>">

si no es ésto. explícalo otra vez, por favor.
------------------------------------------------------------

trasgukabi, aqui te muestro el codigo fuente utilizado para levantar la imagen a la base de datos, estas son dos paginas una que realiza el insertar (insert.asp) y la otra que contiene las funciones para levantar la imagen (loader.asp):

inset.asp

<!--#include file="Loader.asp"-->
<%
Response.Buffer = True

' load object
Dim load
Set load = new Loader

' calling initialize method
load.initialize

' File binary data
Dim fileData
fileData = load.getFileData("file")
' File name
Dim fileName
fileName = LCase(load.getFileName("file"))
' File path
Dim filePath
filePath = load.getFilePath("file")
' File path complete
Dim filePathComplete
filePathComplete = load.getFilePathComplete("file")
' File size
Dim fileSize
fileSize = load.getFileSize("file")
' File size translated
Dim fileSizeTranslated
fileSizeTranslated = load.getFileSizeTranslated("file")
' Content Type
Dim contentType
contentType = load.getContentType("file")
' No. of Form elements
Dim countElements
countElements = load.Count

' Value of text input field "Propiedad"
Dim propiedad
propiedad = load.getValue("propiedad")
' Value of text input field "Transaccion"
Dim transaccion
transaccion = load.getValue("transaccion")
' Value of text input field "Region"
Dim region
region = load.getValue("region")
' Value of text input field "Comuna"
Dim comuna
comuna = load.getValue("comuna")
' Value of text input field "Barrio"
Dim barrio
barrio = load.getValue("barrio")
' Value of text input field "Precio"
Dim precio
precio = load.getValue("precio")
' Value of text input field "Terreno"
Dim terreno
terreno = load.getValue("terreno")
' Value of text input field "Otros"
Dim otros
otros = load.getValue("otros")
' Value of text input field "Detalles"
Dim detalles
detalles = load.getValue("detalles")


' destroying load object
Set load = Nothing
%>

<html>
<head>
<title>.:::::Arquiprop - Desarrollo Inmobiliario:::::.</title>
<style>
body, input, td { font-family:verdana,arial; font-size:10pt; }
</style>
</head>
<body bgproperties="fixed" background="imagenes/brillo.jpg">
<p align="center">
<b>Insertando Datos a la Base De Datos</b><br>
<a href="show.asp">Ver Datos Insertados</a>
</p>

<table width="700" border="1" align="center">
<tr>
<td>File Name</td><td><%= fileName %>&nbsp;</td>
</tr><tr>
<td>File Path</td><td><%= filePath %>&nbsp;</td>
</tr><tr>
<td>File Path Complete</td><td><%= filePathComplete %>&nbsp;</td>
</tr><tr>
<td>File Size</td><td><%= fileSize %>&nbsp;</td>
</tr><tr>
<td>File Size Translated</td><td><%= fileSizeTranslated %>&nbsp;</td>
</tr><tr>
<td>Content Type</td><td><%= contentType %>&nbsp;</td>
</tr><tr>
<td>No. of Form Elements</td><td><%= countElements %>&nbsp;</td>
</tr><tr>
<td>Tipo Propiedad</td><td><%= propiedad %>&nbsp;</td>
</tr><tr>
<td>Transaccion</td><td><%= transaccion %>&nbsp;</td>
</tr><tr>
<td>Region</td><td><%= region %>&nbsp;</td>
</tr><tr>
<td>Comuna</td><td><%= comuna %>&nbsp;</td>
</tr><tr>
<td>Barrio</td><td><%= barrio %>&nbsp;</td>
</tr><tr>
<td>Precio</td><td><%= precio %>&nbsp;</td>
</tr><tr>
<td>Terreno</td><td><%= terreno %>&nbsp;</td>
</tr><tr>
<td>Otros</td><td><%= otros %>&nbsp;</td>
</tr><tr>
<td>Detalles</td><td><%= detalles %>&nbsp;</td>
</tr>
</table><br><br>

<p style="padding-left:220;">
<%= fileName %> Datos recibidos ...<br>
<%
' Checking to make sure if file was uploaded
If fileSize > 0 Then

' Connection string
Dim connStr
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("FileDB.mdb")

' Recordset object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "Files", connStr, 2, 2

' Adding data
rs.AddNew
rs("File Name") = fileName
rs("File Size") = fileSize
rs("File Data").AppendChunk fileData
rs("Content Type") = contentType
rs("Propiedad") = propiedad
rs("Transaccion") = transaccion
rs("Region") = region
rs("Comuna") = comuna
rs("Barrio") = barrio
rs("Precio") = precio
rs("Terreno") = terreno
rs("Otros") = otros
rs("Detalles") = detalles
rs.Update

rs.Close
Set rs = Nothing

Response.Write "<font color=""green"">Archivo Grabado Satisfactoriamente...</font>"
Else
Response.Write "<font color=""brown"">No Fue Seleccionado Ningun Archivo Para Ser Grabado...</font>"
End If


If Err.number <> 0 Then
Response.Write "<br><font color=""red"">Ocurrio Un Error...</font>"
End If
%>
</p>

<br>
<table border="0" align="center">
<tr>
<form method="POST" enctype="multipart/form-data" action="Insert.asp">
<td>Tipo Propiedad :</td><td>
<input type="text" name="propiedad" size="40" value="TipoPropiedad"></td></tr>
<td>Transaccion :</td><td>
<input type="text" name="transaccion" size="40" value="Transaccion"></td></tr>
<td>Region :</td><td>
<input type="text" name="region" size="40" value="Region"></td></tr>
<td>Comuna :</td><td>
<input type="text" name="comuna" size="40" value="Comuna"></td></tr>
<td>Barrio :</td><td>
<input type="text" name="barrio" size="40" value="Barrio"></td></tr>
<td>Precio :</td><td>
<input type="text" name="precio" size="40" value="Precio"></td></tr>
<td>Terreno :</td><td>
<input type="text" name="terreno" size="40" value="Terreno"></td></tr>
<td>Otros :</td><td>
<input type="text" name="otros" size="40" value="Otros"></td></tr>
<td>Detalles :</td><td>
<input type="text" name="detalles" size="40" value="Detalles"></td></tr>

<td>File :</td><td>
<input type="file" name="file" size="40"></td></tr>
<td>&nbsp;</td><td>
<input type="submit" value="Submit"></td></tr>
</form>
</tr>
</table>

</body>
</html>

continua...