Wednesday, April 18, 2012

Flex command issue

I'm having problems with converting .css file into .swf, if i run the flex commad through the shell it's working, but unfortunately through php it's not working.



<?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!";
}
?>




No comments:

Post a Comment