Foros del Web » Programando para Internet » ASP Clásico »

saveany.asp problemas con el tamanio

Estas en el tema de saveany.asp problemas con el tamanio en el foro de ASP Clásico en Foros del Web. Por que saveany.asp no me deja subir archivos mas grandes de 200 kb Saludos Gracias...
  #1 (permalink)  
Antiguo 13/01/2005, 17:57
Avatar de Maxon  
Fecha de Ingreso: diciembre-2001
Ubicación: Monterrey NL
Mensajes: 263
Antigüedad: 23 años, 5 meses
Puntos: 0
saveany.asp problemas con el tamanio

Por que saveany.asp no me deja subir archivos mas grandes de 200 kb


Saludos Gracias
  #2 (permalink)  
Antiguo 13/01/2005, 21:46
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 23 años, 4 meses
Puntos: 4
perdon por la ignorancia pero que es saveany ?
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #3 (permalink)  
Antiguo 13/01/2005, 21:48
Avatar de Maxon  
Fecha de Ingreso: diciembre-2001
Ubicación: Monterrey NL
Mensajes: 263
Antigüedad: 23 años, 5 meses
Puntos: 0
saveany.asp es un codigo en asp que se usa para subir archivos al servidor
  #4 (permalink)  
Antiguo 13/01/2005, 21:57
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 23 años, 4 meses
Puntos: 4
de donde lo bajaste o quien lo hizo? ? para bajarlo y mirar en qeu parte puede estar lo qeu necesitas?
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #5 (permalink)  
Antiguo 13/01/2005, 22:26
Avatar de Maxon  
Fecha de Ingreso: diciembre-2001
Ubicación: Monterrey NL
Mensajes: 263
Antigüedad: 23 años, 5 meses
Puntos: 0
esta en la parte de ejemplos de asptutor.com.ar
  #6 (permalink)  
Antiguo 13/01/2005, 22:34
Avatar de Maxon  
Fecha de Ingreso: diciembre-2001
Ubicación: Monterrey NL
Mensajes: 263
Antigüedad: 23 años, 5 meses
Puntos: 0
http://www.asptutor.com/asp/vart.asp?id=68

perdon..... esta aqui
  #7 (permalink)  
Antiguo 14/01/2005, 07:57
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 23 años, 4 meses
Puntos: 4
ok me meto y en la tarde lo pruebo a ver si te puedo colaborar en algo.
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #8 (permalink)  
Antiguo 14/01/2005, 19:13
Avatar de Maxon  
Fecha de Ingreso: diciembre-2001
Ubicación: Monterrey NL
Mensajes: 263
Antigüedad: 23 años, 5 meses
Puntos: 0
Gracias..... ojala se pueda hacer algo...... lo he visto en otros lugares y si funciona con archivos mas grandes

Saludos
  #9 (permalink)  
Antiguo 14/01/2005, 19:37
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 23 años, 4 meses
Puntos: 4
De acuerdo

mira pues no lo he provado pero vi dos partes en el codigo que pueden ser de lo qeu maneja el peso

Código:
 
noBytes = Request.TotalBytes noBytes = Request.TotalBytes
Código:
 
'Calculate the file size. 
lngDataLenth = lngEndPos - lngBeginPos
'Get the file data 
strFileData = mid(strData,lngBeginPos,lngDataLenth)
'Create the file. 
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(server.mappath("..") & "\TuDirectorio\" &_
 FileName, ForWriting, True)
f.Write strFileData
Set f = nothing
Set fso = nothing
pero en ninguna parte veo qeu se limite a 200k los archivos..

me parece muy raro..

voy acolocar el codigo completo aqui por si alguna otra persona lo entiende mejor que nosotros y lo explica.. ademas is dices que funciona subiendo cualquier tipo de archivos depronto resulta mejor que el xelupload no??? quien sabe,.


Código:
<%@LANGUAGE="VBSCRIPT"%>
<%response.buffer=true
Func = Request("Func")
if isempty(Func) Then
Func = 1
End if
Select Case Func
Case 1
%>

<table width="360" border="0" align="center">
<tr>
<td> 
<div align="center">Selecciona una imagen para subir. </div>
</td>
</tr>
</table>
<FORM ENCTYPE="multipart/form-data" ACTION="saveany.asp?func=2" METHOD=POST id=form1 name=form1> 
<TABLE align="center">
<TR> 
<TD>&nbsp;</TD>
</TR>
<TR> 
<TD><font color="#330066" size="2">Pulsa en el botón examinar y elige el archivo 
de tu ordenador.<BR>
<BR>
</font></TD>
</TR>
<TR> 
<TD><font color="#330066" size="2">Luego pulsa el botón subir.<BR>
<BR>
</font></TD>
</TR>
<TR> 
<TD><STRONG><font color="#330066" size="2">Nombre del archivo...</font></STRONG></TD>
</TR>
<TR> 
<TD> <font size="2"> 
<INPUT NAME=File1 SIZE=30 TYPE=file>
<BR>
</font></TD>
</TR>
<TR> 
<TD align=left> 
<INPUT type="submit" value="Subir">
<BR>
<BR>
</TD>
</TR>
<TR> 
<TD><font color="#330066" size="2">NOTA: Espera, recibirás una notificación 
cuando el archivo haya sido subido</font><font size="2">.<BR>
<BR>
</font></TD>
</TR>
</TABLE>
<%
Case 2
ForWriting = 2
adLongVarChar = 201
lngNumberUploaded = 0

'Get binary data from form 
noBytes = Request.TotalBytes 
binData = Request.BinaryRead (noBytes)
'convery the binary data to a string
Set RST = CreateObject("ADODB.Recordset")
LenBinary = LenB(binData)

if LenBinary > 0 Then
RST.Fields.Append "myBinary", adLongVarChar, LenBinary
RST.Open
RST.AddNew
RST("myBinary").AppendChunk BinData
RST.Update
strDataWhole = RST("myBinary")
End if
'Creates a raw data file for with all da
' ta sent. Uncomment for debuging. 
'Set fso = CreateObject("Scripting.FileSystemObject")
'Set f = fso.OpenTextFile(server.mappath(".") & "\raw.txt", ForWriting, True)
'f.Write strDataWhole
'set f = nothing
'set fso = nothing
'get the boundry indicator
strBoundry = Request.ServerVariables ("HTTP_CONTENT_TYPE")
lngBoundryPos = instr(1,strBoundry,"boundary=") + 8 
strBoundry = "--" & right(strBoundry,len(strBoundry)-lngBoundryPos)
'Get first file boundry positions.
lngCurrentBegin = instr(1,strDataWhole,strBoundry)
lngCurrentEnd = instr(lngCurrentBegin + 1,strDataWhole,strBoundry) - 1
Do While lngCurrentEnd > 0
'Get the data between current boundry an
' d remove it from the whole.
strData = mid(strDataWhole,lngCurrentBegin, lngCurrentEnd - lngCurrentBegin)
strDataWhole = replace(strDataWhole,strData,"")

'Get the full path of the current file.
lngBeginFileName = instr(1,strdata,"filename=") + 10
lngEndFileName = instr(lngBeginFileName,strData,chr(34)) 
'Make sure they selected at least one fi
' le. 
if lngBeginFileName = lngEndFileName and lngNumberUploaded = 0 Then

Response.Write "<H2> Ha ocurrido el siguiente error.</H2>"
Response.Write "Debes elegir un archivo para subir"
Response.Write "<BR><BR>Pulsa el botón volver, realiza la corrección."
Response.Write "<BR><BR><INPUT type='button' onclick='history.go(-1)' value='<< Volver' id='button'1 name='button'1>"
Response.End 
End if
'There could be one or more empty file b
' oxes. 
if lngBeginFileName <> lngEndFileName Then
strFilename = mid(strData,lngBeginFileName,lngEndFileName - lngBeginFileName)
'Creates a raw data file with data betwe
' en current boundrys. Uncomment for debug
' ing. 
'Set fso = CreateObject("Scripting.FileSystemObject")
'Set f = fso.OpenTextFile(server.mappath(".") & "\raw_" & lngNumberUploaded & ".txt", ForWriting, True)
'f.Write strData
'set f = nothing
'set fso = nothing

'Loose the path information and keep jus
' t the file name. 
tmpLng = instr(1,strFilename,"\")
Do While tmpLng > 0
PrevPos = tmpLng
tmpLng = instr(PrevPos + 1,strFilename,"\")
Loop

FileName = right(strFilename,len(strFileName) - PrevPos)

'Get the begining position of the file d
' ata sent.
'if the file type is registered with the
' browser then there will be a Content-Typ
' e
lngCT = instr(1,strData,"Content-Type:")

if lngCT > 0 Then
lngBeginPos = instr(lngCT,strData,chr(13) & chr(10)) + 4
Else
lngBeginPos = lngEndFileName
End if
'Get the ending position of the file dat
' a sent.
lngEndPos = len(strData) 

'Calculate the file size. 
lngDataLenth = lngEndPos - lngBeginPos
'Get the file data 
strFileData = mid(strData,lngBeginPos,lngDataLenth)
'Create the file. 
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(server.mappath("..") & "\TuDirectorio\" &_
 FileName, ForWriting, True)
f.Write strFileData
Set f = nothing
Set fso = nothing

lngNumberUploaded = lngNumberUploaded + 1

End if

'Get then next boundry postitions if any
' .
lngCurrentBegin = instr(1,strDataWhole,strBoundry)
lngCurrentEnd = instr(lngCurrentBegin + 1,strDataWhole,strBoundry) - 1
loop


Response.Write "Archivo subido"
Response.Write lngNumberUploaded & " archivo ya está en el servidor.<BR>"
Response.Write "<BR><BR><INPUT type='button' onclick='document.location=" & chr(34) & "saveany.asp" & chr(34) & "' value='<< Volver' id='button'1 name='button'1>" 
End Select 
%>
</BODY>
</HTML>
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:26.