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

Descargas con IIS 7.5 y asp

Estas en el tema de Descargas con IIS 7.5 y asp en el foro de ASP Clásico en Foros del Web. Estoy haciendo un script para descargar archivos pero no funciona, ya probé con el aspupload y con FSO y con ambos me marca que se ...
  #1 (permalink)  
Antiguo 13/03/2013, 18:44
 
Fecha de Ingreso: mayo-2003
Mensajes: 18
Antigüedad: 20 años, 11 meses
Puntos: 3
Pregunta Descargas con IIS 7.5 y asp

Estoy haciendo un script para descargar archivos pero no funciona, ya probé con el aspupload y con FSO y con ambos me marca que se pierde la conección, en IIS 6 en server 2003 si funcionaban bien pero al pasarlos al server 2008R2 con IIS 7.5 marca errores

en firefox el error es :
La conexión se reinició
La conexión al servidor se reinició mientras se cargaba la página.

Chrome:
Error 103 (net::ERR_CONNECTION_ABORTED): Error desconocido.

IE
Internet Explorer no puede mostrar la página web

este es el script que uso aparte del aspupload
Código:
<%@Language="VBScript"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<%
On Error Resume Next
Dim strPath
strPath = CStr(Request.QueryString("file"))
'-- do some basic error checking for the QueryString
If strPath = "" Then
  Response.Clear
  Response.Write("No file specified.")
  Response.End
ElseIf InStr(strPath, "..") > 0 Then
  Response.Clear
  Response.Write("Illegal folder location.")
  Response.End
ElseIf Len(strPath) > 1024 Then
  Response.Clear
  Response.Write("Folder path too long.")
  Response.End 
ElseIf Right(strPath,4) <> ".jpg" Then ' ...specify the file format(s) to allow download
   Response.Clear
   Response.Write("File extension not supported.")
   Response.End
 Else
  Call DownloadFile(strPath)
End If
Private Sub DownloadFile(file)
  '--declare variables
  Dim strAbsFile
  Dim strFileExtension
  Dim objFSO
  Dim objFile
  Dim objStream
  '-- set absolute file location
  strAbsFile = Server.MapPath(file)
  '-- create FSO object to check if file exists and get properties
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  '-- check to see if the file exists
  If objFSO.FileExists(strAbsFile) Then
	Set objFile = objFSO.GetFile(strAbsFile)
	'-- first clear the response, and then set the appropriate headers
	Response.Clear
	'-- the filename you give it will be the one that is shown
	' to the users by default when they save
	Response.AddHeader "Content-Disposition", "attachment; filename=" & objFile.Name
	Response.AddHeader "Content-Length", objFile.Size
	Response.ContentType = "application/octet-stream"
	Set objStream = Server.CreateObject("ADODB.Stream")
	objStream.Open
	'-- set as binary
	objStream.Type = 1
	Response.CharSet = "UTF-8"
	'-- load into the stream the file
	objStream.LoadFromFile(strAbsFile)
	'-- send the stream in the response
	Response.BinaryWrite(objStream.Read)
	objStream.Close
	Set objStream = Nothing
	Set objFile = Nothing
  Else 'objFSO.FileExists(strAbsFile)
	Response.Clear
	Response.Write("No such file exists.")
  End If
  Set objFSO = Nothing
End Sub
%>

Etiquetas: asp, descargas, iis
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 05:26.