Php 使用flexpaper检索以显示数据库中的swf文件。
swf文件存储在数据库中,需要使用flexpaper显示 这是flexpaper显示文件的代码 present_retrieve.php 但是,该文件不会显示在flexpaper中Php 使用flexpaper检索以显示数据库中的swf文件。,php,flash,flexpaper,Php,Flash,Flexpaper,swf文件存储在数据库中,需要使用flexpaper显示 这是flexpaper显示文件的代码 present_retrieve.php 但是,该文件不会显示在flexpaper中 请帮我弄清楚。谢谢。可能是输出中的某个地方有额外的空间,这会损坏swf文件。检查php脚本中php脚本标记之外的任何前导空格或尾随空格 您的响应中也不需要content disposition标头。我建议swf文件使用以下标题: 标题“内容类型:应用程序/x-shockwave-flash”; 标题“接受范围:字节”
请帮我弄清楚。谢谢。可能是输出中的某个地方有额外的空间,这会损坏swf文件。检查php脚本中php脚本标记之外的任何前导空格或尾随空格 您的响应中也不需要content disposition标头。我建议swf文件使用以下标题: 标题“内容类型:应用程序/x-shockwave-flash”; 标题“接受范围:字节”;
标题“内容长度:”$大小 我已经按照你的建议更改了标题。。。但我仍然面临着同样的问题。。。还有其他解决办法吗?非常感谢…您如何转换swf文件?可能不是响应,而是swf文件不正确。在下面的页面中查看我们推荐的参数:我使用swftool将其转换,然后上传到数据库。。。然后仅从数据库中检索swf文件以使用flexpaper显示
$('#documentViewer').FlexPaperViewer(
{ config : {
SWFFile : '<?php echo "present_retrieve.php?id=".$id.""; ?>',
Scale : 0.6,
ZoomTransition : 'easeOut',
ZoomTime : 0.5,
ZoomInterval : 0.2,
FitPageOnLoad : true,
FitWidthOnLoad : false,
FullScreenAsMaxWindow : false,
ProgressiveLoading : false,
MinZoomSize : 0.2,
MaxZoomSize : 5,
SearchMatchAll : false,
InitViewMode : 'Portrait',
RenderingOrder : 'flash',
StartAtPage : '',
ViewModeToolsVisible : true,
ZoomToolsVisible : true,
NavToolsVisible : true,
CursorToolsVisible : true,
SearchToolsVisible : true,
WMode : 'window',
localeChain: 'en_US' }}
<?php
// Connect to the database
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="is"; // Database name
$tbl_name="presentation"; // Table name
$conn = mysql_connect("$host", "$username", "$password");
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db_name);
if (isset($_GET["id"]) && !empty($_GET["id"])) {
$id= $_GET['id'];
$query = "SELECT file_name, file_type, file_size, content FROM $tbl_name WHERE file_id = '$id'";
$result = mysql_query($query) or die(mysql_error());
$row1 = mysql_fetch_array($result);
$name=$row1['file_name'];
$type=$row1['file_type'];
$size = $row1['file_size'];
$content = $row1['content'];
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$name");
echo $content;
mysql_close($conn);
exit;
}
?>