Hey Guys…
I wana Upload a file with flash and php WITHOUT using FileReference. What I want is to give the exact File Path (of my Computer) to the php File. I tried this, but without any success.
var URLrequest:URLRequest = new URLRequest("http://www.[myServer]/php/uploader_script.php");
filePath.text = "C:\\Users\\Admin\\Pictures\\"
buttonUpload.addEventListener(MouseEvent.CLICK, bUpload);
function bUpload (MouseEvent):void{
var variables:URLVariables = new URLVariables();
variables.Filedata = filePath.text;
variables.name = "new.jpg";
URLrequest.method = URLRequestMethod.POST;
URLrequest.data = variables;
}
and this is my php file:
<?php
$todayDate = $_POST['todayDate'];
$Name = $_POST['Name'];
$Email = $_POST['Email'];
$filename = $_FILES['Filedata']['name'];
$filetmpname = $_FILES['Filedata']['tmp_name'];
$fileType = $_FILES["Filedata"]["type"];
$fileSizeMB = ($_FILES["Filedata"]["size"] / 1024 / 1000);
move_uploaded_file($_FILES['Filedata']['tmp_name'], "files/".$filename);
?>
So… I hope somebody of you can help me!
King regards