Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
nick

Download / Anzeige Probs mit doc,xls,pdf Dateien

Recommended Posts

Hallo,

wenn .doc, .pdf, .xls aus dem Downloadbereich downgeloadet werden,

oder als Anhang in einem Posting geöffnet werden sollen

werden sie direckt im Browser angezeigt

allerdings "nicht lesbar" dargestellt:

Danke Nick

Portal und Board:

MKPortal M1.0 ©2003-2005

Powered by Invision Power Board(U) v1.3 Final © 2003 IPS, Inc.

Share this post


Link to post

Hallo Stefan,

Klasse DANKE

gemacht und geht

weisst du zufällig auch die Lösung fürs Portal / dem Download bereich vom Portal?

Share this post


Link to post

Ich kenne den Sourcecode des Portals nicht, aber es wird das gleiche Problem sein. Durchsuch mal die entsprechenden Dateien vom Portal nach header und wenn du diese gefunden hast und nicht weiß, wie man sie umbaut, dann poste sie mal hier ins Forum.

Share this post


Link to post

Vielen Dank vorab

hier mal der Code der es sein könnte für den Download Bereich

function download_file() {

global $mkportals, $DB, $mklib, $mklib_board;

$file= $mkportals->input['file'];

$ide= $mkportals->input['ide'];

$query = $DB->query( "SELECT downloads FROM mkp_download where id = '$ide'");

$row = $DB->fetch_row($query);

$downloads = $row['downloads'];

++$downloads;

$DB->query("UPDATE mkp_download SET downloads ='$downloads' where id = '$ide'");

$DB->close_db();

$real_file = "mkportal/modules/downloads/file/mk_".$ide."_".$file;

$real_file = preg_replace("`(.*)\..*`", "\\1", $real_file);

$real_file .= ".mk";

if (is_file("mkportal/modules/downloads/file/".$file)) {

rename("mkportal/modules/downloads/file/".$file, $real_file);

}

@header( "Content-Type: application/octet-stream\nContent-Disposition: inline; filename=\"".$file."\"\nContent-Length: ".(string)(filesize( $real_file ) ) );

$fh = fopen( $real_file, 'rb' );

fpassthru( $fh );

@fclose( $fh );

exit();

}

Ich gehe mal davon aus das es der "rote Part ist

der war es, und so gehört es

@header("Content-Type: application/octet-stream");

@header("Content-Disposition: inline; filename=\"".$file."\"");

@header("Content-Length: ".(string)(filesize( $real_file ) ) );

Vielen Dank für deine Hilfe

Güsse vom Nick

Edited by Stefan

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×