FileRef driving me nuts!

Hello there,
I understand the concept so far but i don’t understand the last part when it’s to send to php the filename and move the file to the correct dir… i’m lost…


btupload.onPress = function() {	fileRef.upload("upload.php?file="+fileRef.name);
trace(fileRef.name) // outputs mypic.jpg 
};

So i guess this should send my php file the filename. I trace it and it’s ok. But it doesn’t seem to call my php at all…

Here’s my php script:


<?php
$uploadDir = 'images';
$uploadFile = $uploadDir . $_FILES['file']['filename'];
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile))
{
$writeStatus = "File uploaded successfully.";
}
else
{
$writeStatus = "unsuccessful!"
}
?>

So my question is: am i sending the right stuff to php?? I get confused with the $_FILES[‘file’][‘filename’]… Also do i need to write the full path for the uploadDir? does it have something to do with my php uploadtemp dir?

TiA :slight_smile: