【问题标题】:I cant Upload SWF Files With PHP我无法使用 PHP 上传 SWF 文件
【发布时间】:2015-05-18 18:12:02
【问题描述】:

我有 1 种形式的 2 个输入文件。当我尝试发布带有显示其属性的图像 print_rvar_dump 时。

但是当我尝试使用 swf print_rvar_dump 发帖时说空且无法发帖。

那么我怎样才能上传 swf 文件呢?谢谢。

echo var_dump($_FILES);

if($_FILES["oyun_yolu_file"]["type"] == "application/x-shockwave-flash")
{
    echo "aha";
    echo var_dump($_FILES["oyun_yolu_file"]);
}

我已经上传了代码,但我的问题是我无法上传 swf 文件,我可以上传普通文件,如 txt、图片等。

<form action="" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Resim Yolu</td>
<td>
<input type="text" name="resim_yolu" class="resim_yolu" style="width:260px !important" />
<span id="kirmizi" style="padding:0px 10px">yada</span>
<input type="file" name="resim_yolu_file" class="resim_yolu_file" />
</td>
</tr>

<tr>
<td>Oyun Yolu</td>
<td>
<input type="text" name="oyun_yolu" class="oyun_yolu" style="width:260px !important" />
<span id="kirmizi" style="padding:0px 10px">yada</span>
<input type="file" name="oyun_yolu_file" class="oyun_yolu_file" />
</td>
</tr>
</table>
</form>

【问题讨论】:

  • 到目前为止您尝试了什么?显示代码。
  • @QaisarSatti 我正在等待你的评论
  • 也需要表单html代码
  • @QaisarSatti 我添加了
  • 我自己测试了这段代码,添加提交按钮没问题

标签: php file input flash


【解决方案1】:

我自己测试了这段代码,它正在工作

<?php
//echo var_dump($_FILES);
if(isset($_POST['add']))
{
if($_FILES["oyun_yolu_file"]["type"] == "application/x-shockwave-flash")
{
    echo "aha";
    echo var_dump($_FILES["oyun_yolu_file"]);
}}
 ?>
<form action="" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Oyun Yolu</td>
<td>
<input type="text" name="oyun_yolu" class="oyun_yolu" style="width:260px !important" />
<span id="kirmizi" style="padding:0px 10px">yada</span>
<input type="file" name="oyun_yolu_file" class="oyun_yolu_file" />
</td>
</tr>

<tr>
<td>Oyun Açıklaması</td>
<td>
<textarea cols="45" rows="5" name="oyun_aciklama" style="width:264px !important; padding:4px;"></textarea>
</td>
</tr>
<tr><td>
<input type="submit" name="add">
</td></tr></table>
</form>

输出是检查你的文件

ahaarray(5) { ["name"]=> string(23) "Car-speakers-590x90.swf" ["type"]=> string(29) "application/x-shockwave-flash " ["tmp_name"]=> string(23) "E:\xamp\tmp\php7D0E.tmp" ["error"]=> int(0) ["size"]=> int(116887) }

【讨论】:

  • 谢谢@Qaisar Satti swf 文件在 Flash Player 投影仪上工作,但我不知道为什么不能在输入文件中工作:D 也许他们正在保护 swf 文件。无论如何,我测试了另一个 swf 文件并且工作很傻:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-03-08
  • 2015-07-18
  • 2013-03-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多