我有两个输入文件在一个形式。当我试图发布图像print_r
或var_dump
显示其属性。
但是当我尝试用swf print_r
或var_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文件,我可以上传文本,图像等常规文件
<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>
我自己测试了这段代码,它是工作的
<?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>
输出是check your file
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"("错误")=> int(0)["大小"]=> int (116887)}