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

Problema Al Forzar Descargas Grandes

Estas en el tema de Problema Al Forzar Descargas Grandes en el foro de ASP Clásico en Foros del Web. Tengo el archivo XXX.zip el cual envio a pagina de descarga asi: download.asp?file=XXX.zip&name=archivo.zip al tratar de descargar archivos mayores a 8 mb la descarga nunca ...
  #1 (permalink)  
Antiguo 05/01/2007, 08:36
 
Fecha de Ingreso: agosto-2003
Ubicación: Providencia - Santiago
Mensajes: 31
Antigüedad: 20 años, 8 meses
Puntos: 0
Problema Al Forzar Descargas Grandes

Tengo el archivo XXX.zip

el cual envio a pagina de descarga asi: download.asp?file=XXX.zip&name=archivo.zip

al tratar de descargar archivos mayores a 8 mb la descarga nunca se inicia, y queda esperando.

este es la funcion que utilizo en la pagina download.asp

SOLO SE PRODUCE CUANDO EL ARCHIVO ES GRANDE, SINO NO HAY PROBLEMA. y NECESITO REALIZARLO MAS O MENOS ASI, PUES EL NOMBRE DEL ARCHIVO ORIGINAL ES DISTINTO AL DEL QUE LE ENVIO AL CLIENTE O USUARIO

Código:
Function Download()
Response.Buffer = True
Dim strFilePath, strFileSize, strFileName
Const adTypeBinary = 1
strFilePath = Request.QueryString("File")
strFileSize = Request.QueryString("Size")
strFileName = Request.QueryString("Name")
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
strFileType = lcase(Right(strFileName, 4))
Select Case strFileType
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case ".pdf"
ContentType = "application/pdf"
Case Else
'Handle All Other Files
ContentType = "application/octet-stream"
End Select
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Response.AddHeader "Content-Length", strFileSize
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
End Function

desde ya muchas gracias:
__________________
No solo de pan vive el hombre y solo de errores se aprende.
  #2 (permalink)  
Antiguo 30/04/2007, 03:41
 
Fecha de Ingreso: enero-2002
Mensajes: 86
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Problema Al Forzar Descargas Grandes

Muy Buenas,

Se me ha presentado ese mismo problemón con esta función, y no tengo ni idea de como resolverlo despues de darle 1000 vueltas.Te agradecería que si has encontrado la solución me ayudases,

Muchas Gracias.
  #3 (permalink)  
Antiguo 02/03/2015, 07:20
 
Fecha de Ingreso: enero-2004
Ubicación: Toledo
Mensajes: 2
Antigüedad: 20 años, 3 meses
Puntos: 0
Respuesta: Problema Al Forzar Descargas Grandes

MODIFICAR ESTO:

Response.BinaryWrite objStream.Read
response.flush

POR ESTO:

while not objStream.EOS
Response.BinaryWrite(objStream.Read(1024*256))
Response.flush
wend
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 21:01.