Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

phew

Codigo php nao funciona no ie7

Recommended Posts

Quero que o usuario ao clicar no link seja forçado a baixar o flash ao invez de visualizar. O problema é que fiz um codigo e ele só nao funciona no I.E7 tem alguma maneira de arrumar isso?

 

$filepath = $_GET['arquivo'];$filename = $_GET['arquivo'];Header( "Content-Type: application/octet-stream" );Header( "Content-Length:" . filesize( $filepath ) );Header( "Content-Disposition: attatchment; filename=$filename" );readfile( $filepath );

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente com:

 

header("Content-Type: application/save");header("Content-Length:" . filesize($filepath));header("Content-Disposition: attatchment; filename=$filename");header("Expires: 0");header("Pragma: no-cache");readfile($filepath);

[]s

Anderson Mello

Compartilhar este post


Link para o post
Compartilhar em outros sites

$fpath =  $_GET[ 'file' ];  $fsize = filesize( $fpath );  $bufsize = 20000;  header('HTTP/1.1 200 OK');  header('Status: 200 OK');  header('Accept-Ranges: bytes');  header('Content-Transfer-Encoding: Binary');  header('Content-Type: image/jpg');  header("Content-Length: $fsize");  header('Content-Type: application/force-download');  header("Content-Disposition: inline; filename=".basename( $fpath ) ); if(file_exists( $fpath ) && $fh = fopen( $fpath, "rb" )){ 	while( $buf = fread( $fh, $bufsize ))		 print $buf;	fclose( $fh );	  }else {	header("HTTP/1.1 404 Not Found"); }

Tenta usar esse script, não tenho certeza se funcionar no ie7.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.