Ver Mensaje Individual
  #11 (permalink)  
Antiguo 21/07/2005, 21:04
juanpablomonte
 
Fecha de Ingreso: julio-2005
Ubicación: Córdoba
Mensajes: 254
Antigüedad: 18 años, 10 meses
Puntos: 0
esta es la solucion, armate estas tres pages que te doy aca y con eso basta
para meter imagenes en acces Acces... mi ejemplo esta en www.arteca.com.ar/insert.htm

Código HTML:
<!-- insert.htm -->
<html>
	<head>
		<title>Inserts Images into Database</title>
		<style>
		body, input { font-family:verdana,arial; font-size:10pt; }
	</style>
	</head>
	<body>
		<p align="center">
			<b>Ingrese la imagen que desea enviar</b><br>
		</p>
		<table border="0" align="center">
			<tr>
				<form method="POST" enctype="multipart/form-data" action="Insert.asp">
					<td>Nombre Completo :</td>
					<td>
						<input type="text" name="fname" size="40"></td>
			</tr>
			<td>Comentario :</td>
			<td>
				<input type="text" name="lname" size="40"></td>
			</tr>
			<td>edad :</td>
			<td>
				<input type="text" name="profession" size="40">
			</td>
			</tr>
			<td>Archivo :</td>
			<td>
				<input type="file" name="file" size="40"></td>
			</tr>
			<td>
			</td>
			<td>
				<input type="submit" value="Enviar"></td>
			</tr> </form> </tr>
		</table>
	</body>
</html> 
luego insert.asp

Código HTML:
<HTML>
	<HEAD>
		<title>Inserts Images into Database</title><% ' Insert.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 "fname"
  Dim fnameInput
    fnameInput = load.getValue("fname")
  ' Value of text input field "lname"
  Dim lnameInput
    lnameInput = load.getValue("lname")
  ' Value of text input field "profession"
  Dim profession
    profession = load.getValue("profession")  
    
  ' destroying load object
  Set load = Nothing
%>
		<style> body, input, td { font-family:verdana,arial; font-size:10pt; }
	</style>
	</HEAD>
	<body>
		<p align="center">
			<b>Estos son los datos del archivo enviado </b>
			<br>
		</p>
		<table width="700" border="1" align="center">
			<tr>
				<td>Nombre de Archivo</td>
				<td><%= fileName %></td>
			</tr>
			<tr>
				<td>URL :</td>
				<td><%= filePath %></td>
			</tr>
			<tr>
				<td>URL Completa</td>
				<td><%= filePathComplete %></td>
			</tr>
			<tr>
				<td>Tamaño
				</td>
				<td><%= fileSize %></td>
			</tr>
			<tr>
				<td>File Size Translated</td>
				<td><%= fileSizeTranslated %></td>
			</tr>
			<tr>
				<td>Tipo de archivo</td>
				<td><%= contentType %></td>
			</tr>
			<tr>
				<td>No. of Form Elements</td>
				<td><%= countElements %></td>
			</tr>
			<tr>
				<td>Nombre :</td>
				<td><%= fnameInput %></td>
			</tr>
			<tr>
				<td>Comentario :</td>
				<td><%= lnameInput %></td>
			</tr>
			<tr>
				<td>Edad :</td>
				<td><%= profession %></td>
			</tr>
		</table>
		<br>
		<br>
		<p style="PADDING-LEFT:220px">
			<%= fileName %>
			data received ...<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="
        connStr = connStr & 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("FileSize") = fileSize
          rs("FileData").AppendChunk fileData
          rs("ContentType") = contentType
          rs("First Name") = fnameInput
          rs("Last Name") = lnameInput
          rs("Profession") = profession
        rs.Update
        
        rs.Close
        Set rs = Nothing
        
      Response.Write "<font color=""green"">File was successfully uploaded..."
      Response.Write "</font>"
    Else
      Response.Write "<font color=""brown"">No file was selected for uploading"
      Response.Write "...</font>"
    End If
      
      
    If Err.number <> 0 Then
      Response.Write "<br><font color=""red"">Something went wrong..."
      Response.Write "</font>"
    End If
  %>
		</p>
		<b>Si desea ingresar otra imagen, llene los datos nuevamente. Sino,<A href="webform1.aspx">
				haga click</A> aqui para salir.</b>
		<br>
		<table border="0" align="center">
			<tr>
				<form method="post" enctype="multipart/form-data" action="Insert.asp">
					<td>Nombre Completo :</td>
					<td>
						<input type="text" name="fname" size="40"></td>
			</tr>
			<TR>
				<td>Comentario :</td>
				<td>
					<input type="text" name="lname" size="40"></td>
			</TR>
			<TR>
				<td>Edad :</td>
				<td>
					<input type="text" name="profession" size="40"></td>
			</TR>
			<TR>
				<td>Archivo :</td>
				<td>
					<input type="file" name="file" size="40"></td>
			</TR>
			<TR>
				<td>
				</td>
				<td>
					<input type="submit" value="Enviar"></td>
			</TR>
			</FORM></TR>
		</table>
	</body>
</HTML>