Subir fotos a un servidor asp

22/10/2003 - 13:55 por Paco Jimenez | Informe spam
Hola,
Me gustaria saber si alguien me podria ayudar.
Kiero subir unas fotos a mi servidor, y guardar el path en la bbdd.
Trabajo con asp,vbscript y sqlserver.
El problema es que con el method post y el enctype multipart/form-data me
pasan los datos del formulario vacios y no entiendo porque.
Ademas utilizo un codigo que podeis ver en esta pagina
http://www.sloppycode.net/sloppycode/ASP/cm12.html para subir imagenes pero
no hay manera..
Bueno si alguien me puede echar una mano lo agradeceria.
Salu2
 

Leer las respuestas

#1 urko
22/10/2003 - 16:25 | Informe spam
Segun el componente que utilizes
el acceso con MULTIPART es diferente
no vale el request.form
mira el componente que utilizas para subir los ficheros
tendras alguna pagina que te muestre com o acceder a los campos de los
formularios.
con aspsmartupload seria algo asi...y perdon por meter asi el codigo:

<%
' Variables
' *********
Dim mySmartUpload
Dim item
Dim value
Dim file

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Upload
' ******
mySmartUpload.Upload

' FILES Collection
' ****************
Response.Write("<BR><STRONG>Files Collection</STRONG><BR>")

' Informations about files
' ************************
Response.Write("Number of files =" & mySmartUpload.Files.count &"<BR>")
Response.Write("Total bytes of files =" & mySmartUpload.Files.TotalBytes
&"<BR>")

' Select each file
' ****************

' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Save the files with his original names in a virtual path of the web
server
'
****************************************************************************
file.SaveAs("/aspSmartUpload/Upload/" & file.FileName)
' sample with a physical path
' file.SaveAs("c:\temp\" & file.FileName)

' Display the properties of the current file
' ******************************************
Response.Write("Name = " & file.Name & "<BR>")
Response.Write("Size = " & file.Size & "<BR>")
Response.Write("FileName = " & file.FileName & "<BR>")
Response.Write("FileExt = " & file.FileExt & "<BR>")
Response.Write("FilePathName = " & file.FilePathName & "<BR>")
Response.Write("ContentType = " & file.ContentType & "<BR>")
Response.Write("ContentDisp = " & file.ContentDisp & "<BR>")
Response.Write("TypeMIME = " & file.TypeMIME & "<BR>")
Response.Write("SubTypeMIME = " & file.SubTypeMIME & "<BR>")
intCount = intCount + 1
End If
Next

' FORM Collection
' ***************
Response.Write("<BR><STRONG>Form Collection</STRONG><BR>")

' Select each item
' ****************
For each item In mySmartUpload.Form
' Select each value of the current item
' *************************************
For each value In mySmartUpload.Form(item)
Response.Write(item & " = " & value & "<BR>")
Next
Next
%>



"Paco Jimenez" escribió en el mensaje
news:bn5r84$3k1$
Hola,
Me gustaria saber si alguien me podria ayudar.
Kiero subir unas fotos a mi servidor, y guardar el path en la bbdd.
Trabajo con asp,vbscript y sqlserver.
El problema es que con el method post y el enctype multipart/form-data me
pasan los datos del formulario vacios y no entiendo porque.
Ademas utilizo un codigo que podeis ver en esta pagina
http://www.sloppycode.net/sloppycode/ASP/cm12.html para subir imagenes


pero
no hay manera..
Bueno si alguien me puede echar una mano lo agradeceria.
Salu2




Preguntas similares