Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/09/2009, 09:48
Avatar de Myakire
Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 23 años
Puntos: 146
Respuesta: Ver archivos del servidor

mmmmm

Tienes esta linea en tu código que baja el archivo?:

Response.AddHeader "Content-Disposition", "attachment; filename=" & variableConElNombreDelArchivo

Ejemplo que descarga archivos del servidor

Código ASP:
Ver original
  1. Response.Buffer = True
  2. Dim strFilePath, strFileSize, strFileName
  3. Const adTypeBinary = 1
  4. strFilePath = Request.QueryString("File")
  5. strFileSize = Request.QueryString("Size")
  6. strFileName = Request.QueryString("Name")
  7. Response.Clear
  8.  
  9. 'printlnf(strFilePath & "  " & strFileSize & "  " & strFileName)
  10.  
  11. Set objStream = Server.CreateObject("ADODB.Stream")
  12. objStream.Open
  13. objStream.Type = adTypeBinary
  14. objStream.LoadFromFile strFilePath
  15. strFileType = lcase(Right(strFileName, 4))
  16. Select Case strFileType
  17.   Case ".asf"
  18.     ContentType = "video/x-ms-asf"
  19.   Case ".avi"
  20.     ContentType = "video/avi"
  21.   Case ".txt"
  22.     ContentType = "text/plain"
  23.   Case ".doc"
  24.     ContentType = "application/msword"
  25.   Case ".zip"
  26.     ContentType = "application/zip"
  27.   Case ".xls"
  28.     ContentType = "application/vnd.ms-excel"
  29.   Case ".gif"
  30.     ContentType = "image/gif"
  31.   Case ".jpg", "jpeg"
  32.     ContentType = "image/jpeg"
  33.   Case ".wav"
  34.     ContentType = "audio/wav"
  35.   Case ".mp3"
  36.     ContentType = "audio/mpeg3"
  37.   Case ".mpg", "mpeg"
  38.     ContentType = "video/mpeg"
  39.   Case ".rtf"
  40.     ContentType = "application/rtf"
  41.   Case ".htm", "html"
  42.     ContentType = "text/html"
  43.   Case ".asp"
  44.     ContentType = "text/asp"
  45.   Case ".pdf"
  46.     ContentType = "application/pdf"
  47.   Case Else
  48.     'Handle All Other Files
  49.     ContentType = "application/octet-stream"
  50. End Select
  51. Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
  52. Response.AddHeader "Content-Length", strFileSize
  53. Response.Charset = "UTF-8"
  54. Response.ContentType = ContentType
  55. Response.BinaryWrite objStream.Read
  56. Response.Flush
  57. objStream.Close
  58. Set objStream = Nothing