Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. matte9995
    3. Post
    M

    matte9995

    @matte9995

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 1
    • Post 1
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Località Finale Emilia Età 30
    0
    Reputazione
    1
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da matte9995

    • Problema download file dal database

      Ciao a tutti, avrei un problema con script per il download dei file da una tabella del database.
      Questo script ho visto che va funziona con i vari tipi di file ma mi da un problema con i file compressi, ovvero mi dice File danneggiato o in un formato sconosciuto.

      Qualcuno saprebbe come aiutarmi?

      <?php
      // Includo la connessione al database
      require('../config.php');

      if($_GET['id'] == "")
      header("Location: predownload.php");

      // Query per recuperare il file
      $query = "SELECT * FROM tabella_file WHERE id = " . $_GET["id"];
      $risultato = mysql_query($query)
      or die("Query non valida: " . mysql_error());
      $tmp = mysql_fetch_array($risultato);

      header('Content-Description: File Transfer'); 
      header('Content-Transfer-Encoding: binary'); 
      header("Content-Type: {$tmp['tipo']}"); 
      header("Content-Disposition: attachment; filename={$tmp['nome']}"); 
      header("Content-Length: {$tmp }"); 
      header('Expires: 0'); 
      header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); 
      header('Pragma: public'); 
      
      
      echo $tmp['dati']; 
      

      ?>

      postato in Coding
      M
      matte9995