So, in my PHP script called from Flash I use the following which works a treat with internet explorer in uploading a file to a server side folder that I've created.
PHP Code:
$foldername = $_POST["foldername"];
$dir = "../Orders/" . $foldername . "/";
//$dir = $foldername . "/";
if (!file_exists($dir)) mkdir($dir, 0755);
// create folder if it doesn't exist
$targetdir = $dir . $filename;
if (file_exists($targetdir)) {
echo "Success"; //file already uploaded in PageCountPHP
}
else{
if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $targetdir)) {
echo "Success";
}
However, it fails when using chrome or firefox.
After much searching, I discovered its the relative paths with embeded SWFs in websites, meaning that the path used from IE is from the web page holding the SWF, but chrome/firefox its relatiuve to the folder holding the SWF. I've copied the PHP to another folder so that there's two versions and now it works.
However! It now has two different locations for the server-side folder depending on which version of PHP it uses. As the PHP uses relative folders, is there a way of using absolute folders so that it is save in the correct folder no matter which version of bwoswer is being used?
Or is the simple solution to have the SWF in the root folder with teh webpage?
Hope this makes sens and thanks in advance!!