PHP Create Download Link -


<?php     $file = sevence_data_root."/resource/devdemo/promo_card.tiff";     header('content-description: file transfer');     header('content-type: application/tiff');     header("content-type: application/force-download");// browsers need     header("content-disposition: attachment; filename=promo_card.tiff");     header('expires: 0');     header('cache-control: must-revalidate, post-check=0, pre-check=0');     header('pragma: public');     header('content-length: ' . filesize($file));     ob_clean();     flush();     readfile($file);     exit; ?> 

my issue download image can't viewed. can me issue?

content-type: application/force-download");// browsers need 

no browser need this. it's dirty glitch..

reasons why file cannot opened:

  1. you have space or invisible characters @ beginning of script

  2. the path loading file might wrong , doesn't read (what size downloaded file?)

  3. the file corrupt

  4. you don't have tiff-viewer

the correct mime type image/tiff (instead of application/tiff)


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -