我在将 .css 文件转换为 .swf 时遇到问题,如果我通过 shell 运行 flex commad 它可以正常工作,但不幸的是通过 php 无法正常工作。
<?php
$tm = time();
$file_n = $_FILES["file"]["name"];
$path = "";
if ($_FILES["file"]["type"] == "text/css") {
if ($_FILES["file"]["error"] > 0) {
return "Error has occured: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if (file_exists("upload/" . $_FILES["file"]["name"])) {
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $tm . "_" . $file_n);
$path = "upload/" . $tm . "_" . $file_n;
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
$path = "upload/" . $file_n;
}
}
$paths = explode(".", $path);
exec("mxmlc ".$file_n);
$parr = array('path' => $paths[0].".swf");
$jurl = json_encode($parr);
echo $jurl;
}
else
{
echo "Sorry not supported file type!";
}
?>