Word or Excel in IE 8

Casper

ProgressTalk.com Moderator
Staff member
Put a mime header on it and stream it to the web browser.
And second: Why would you want to call an office application on the appserver?

Reagrds,

casper.
 

seductive

Member
Put a mime header on it and stream it to the web browser.
And second: Why would you want to call an office application on the appserver?

Reagrds,

casper.


uhmmm.. i like to view because i create a sample template for a letter..
what kind of mime header?
 
/* Figure out the MIME type (if not specified) */
$known_mime_types=array(
"pdf" => "application/pdf",
"txt" => "text/plain",
"html"=> "text/html",
"htm" => "text/html",
"exe" => "application/octet-stream",
"zip" => "application/zip",
"doc" => "application/msword",
"xls" => "application/vnd.ms-excel",
"ppt" => "application/vnd.ms-powerpoint",
"gif" => "image/gif",
"png" => "image/png",
"jpeg"=> "image/jpg",
"jpg" => "image/jpg",
"php" => "text/plain"
);
 
I used php, not webspeed

<?php

$method = $_GET['method'];
$name = $_GET['name'];

/* Figure out the MIME type (if not specified) */
$known_mime_types=array(
"pdf" => "application/pdf",
"txt" => "text/plain",
"html"=> "text/html",
"htm" => "text/html",
"exe" => "application/octet-stream",
"zip" => "application/zip",
"doc" => "application/msword",
"xls" => "application/vnd.ms-excel",
"ppt" => "application/vnd.ms-powerpoint",
"gif" => "image/gif",
"png" => "image/png",
"jpeg"=> "image/jpg",
"jpg" => "image/jpg",
"php" => "text/plain"
);

$file_extension = strtolower(substr(strrchr($name,"."),1));
if(array_key_exists($file_extension, $known_mime_types))
{
$mime_type=$known_mime_types[$file_extension];
} else
{
$mime_type="application/force-download";
};

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {

// get bytearray
$rawfile = $GLOBALS["HTTP_RAW_POST_DATA"];

// add headers for download dialog-box
header('Content-Type: ' . $mime_type);
header('Content-Length: '.strlen($rawfile));
header('Content-disposition:'.$method.'; filename="'.$name.'"');
echo $rawfile;

} else echo 'An error occured.';
?>

You just have to create html header and attach file to output
 
i am not expert


<script language="SpeedScript">
DEFINE VARIABLE s1 AS CHARACTER INITIAL "".
DEFINE VAR mFile AS MEMPTR NO-UNDO.

s1 = get-value("filename").

{&out} '
<html>
<head>
<meta http-equiv="Content-Type" content="application/msword">
</head>
'.

COPY-LOB from file filename to mFile.
{&out} mfile.
</script>
 
Top