# FileRef driving me nuts!

**URL:** <https://forum.kirupa.com/t/fileref-driving-me-nuts/172950>\
**Category:** Uncategorized\
**Created:** [December 19, 2005, 9:20pm UTC](https://forum.kirupa.com/t/fileref-driving-me-nuts/172950 "2005-12-19T21:20:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [December 19, 2005, 9:20pm UTC](https://forum.kirupa.com/t/fileref-driving-me-nuts/172950/1 "2005-12-19T21:20:06Z")

</div>

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…

```auto

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:

```auto

<?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 🙂
