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. aviscome
    3. Post
    A

    aviscome

    @aviscome

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

    Post creati da aviscome

    • RE: Problema con il download di un file pdf

      Ho provato ad inserire il codice che mi hai postato,
      ma non ho risolto.
      Non mi dà errore, ma nella mascherina che mi si apre,
      dove mi chiede se voglio salvare o aprire il file, non mi segnala
      la dimensione del file.
      E' come se legesse 0 KB.
      Con un file più piccolo (3,77 Mega) funziona tutto, anche se poi, aprendolo e scorrendo le varie pagine, mi dà un errore di disegno.
      Grazie

      postato in Coding
      A
      aviscome
    • RE: Problema con il download di un file pdf

      Lo script che utilizzo è il seguente:
      [php]<?php
      $file_name = "2005.pdf"; # file name, UTF-8 encoded
      $file_mime = "application/pdf"; # MIME type
      $file_path = "portaldata/UserFiles/File/2005.pdf";
      header("Content-Type: octet-stream");
      header("Content-Length: " . filesize($file_path));
      $agent = $SERVER["HTTP_USER_AGENT"];
      if( is_int(strpos($agent, "MSIE")) ){
      # Remove reserved chars: 😕?"<>|
      $fn = preg_replace('/[:\x5c\/
      ?"<>|]/', '
      ', $file_name);
      # Non-standard URL encoding:
      header("Content-Disposition: attachment; filename="
      . rawurlencode($fn));
      } else if( is_int(strpos($agent, "Gecko")) ){
      # RFC 2231:
      header("Content-Disposition: attachment; filename*=UTF-8''"
      . rawurlencode($file_name));
      } else if( is_int(strpos($agent, "Opera")) ) {
      # Remove reserved chars: 😕{?
      $fn = preg_replace('/[:\x5c\/{?]/', '_', $file_name);
      # RFC 2231:
      header("Content-Disposition: attachment; filename
      =UTF-8''"
      . rawurlencode($fn));
      } else {
      # RFC 2616 ASCII-only encoding:
      $fn = mb_convert_encoding($file_name, "US-ASCII", "UTF-8");
      $fn = (string) str_replace("\", "\\", $fn);
      $fn = (string) str_replace(""", "\"", $fn);
      header("Content-Disposition: attachment; filename="$fn"");
      }
      readfile($file_path);

      ?>[/php]

      Il problema che il file pdf (creto con INdesign) è di 22 Mega
      e sembra non riesco a fare il download di file superiori a 3 Mega.

      postato in Coding
      A
      aviscome
    • Problema con il download di un file pdf

      Salve,
      sono nuovo e non so bene come funziona.
      Ho un problema con il download di un file pdf
      con uno script in PHP, e mi serviva un aiuto.
      Sono nel posto giusto....

      postato in Coding
      A
      aviscome