Hi, I'm new in flex.i face a huge problem of the filereference class using the upload function. Actually i want to send the folderLocation variable with fileReference.upload(). Below i try to describe my strategy.Please help me with code correction.
var folderLocation : String = "photos/myUniqueFolder/";
private var serverSideScript:String = "http://localhost/project/phpFlexMechanism/upload.php"; urlRequest = new URLRequest(serverSideScript);
fileReferenceList.addEventListener(Event.SELECT, fileSelectedHandler);
private function fileSelectedHandler(event:Event):void { // upload the file to the server side script fileReference.addEventListener(Event.COMPLETE, uploadCompleteHandler); fileReference.upload(urlRequest); }
In php i use this to get the the file and uploaded
$folder = $_POST['folder'];
$tempFile = $_FILES['Filedata']['tmp_name']; $fileName = $_FILES['Filedata']['name']; $fileSize = $_FILES['Filedata']['size'];
move_uploaded_file($tempFile, "../user/$folder/uploadImages/" . $fileName);
But how can i send the "folder" thgouth the "upload reference".