Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Aiuto.. Download file binary

    Ciao a tutti,

    in un DB SQL ho incorporati dei file, devo scaricarli da browser, dopo tante prove e ricerche sono riuscito a fare una pagina che mi fa il download del file con nome ed estensione corretta.

    Fa il download ma poi non si aprono che siano .doc .pdf .dxf ecc ecc

    word lo apre in testo ascii come posso fare?????

    ecco il codice:

    <%
    Response.ContentType = "application/octet-stream"
    ' let the browser know the file name
    Response.AddHeader "Content-Disposition", "attachment;filename=" & Trim(REPOSITORY("FileName"))

    Response.BinaryWrite REPOSITORY("FileData")
    %>

  2. #2
    ho provato anche questa

    strFileType = lcase(Right(strFileName, 4))

    ' Feel Free to Add Your Own Content-Types Here
    Select Case strFileType
    Case ".pdf"
    ContentType = "application/pdf"
    Case ".dxf"
    ContentType = "application/dxf"
    Case ".dwg"
    ContentType = "application/dwg"
    Case ".zip"
    ContentType = "application/zip"
    ContentType = "application/x-zip-compressed"
    Case ".xls"
    ContentType = "application/vnd.ms-excel"
    Case ".doc"
    ContentType = "application/msword"
    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 Else
    'Handle All Other Files
    ContentType = "application/octet-stream"
    End Select

    e sostituisco il Response.ContentType =

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.