I created a Flash script that allows to upload a file to a dynamic folder.
The script can upload the files but in the same folder as the SWF file
I managed to do the following:
I created an Array with the 12 months of the year, when I choose a Month I use this script:
Code: Select all
<?php
$month = $_POST['month'];
$finalMonth = '"'.$month.'"';
$monthHandler = fopen("variable.txt", "w");
@fwrite($monthHandler, $finalMonth);
?>Everything is fine until here with no problems, because I got the String that I needed.
Now here comes my nightmare, the following is the code that uploads the file (Note that it works but it doesn´t move the file to the desired folder ):
Code: Select all
<?php
$file = fopen("variable.txt","r");
$destino = fread($file,filesize("variable.txt"));
move_uploaded_file($_FILES['Filedata']['tmp_name'], $destino.$_FILES['Filedata']['name']);
echo($destino);
fclose($file);
?>So I want that the function use that variable to move to the desired folder.
Tell me if you want more explanation.
Thx