Help please with uploading file with flash and php

hi guys im a newbie here
im currently having a proble with uploading an image with Flash
I used filereference

The deal is that i should save first the file to be uploaded in a variable
then after all needed has been entered there will be a save button at the end
how will i be able to save the file saved in my variable in the database

tnx tnx tnx

— here’s my actionscript
import flash.net.FileReference;
var listener:Object = new Object();
var imageFile:FileReference = new FileReference();

imageFile.addListener(listener);

listener.onSelect = function(selectedFile:FileReference):Void {
_global.filename1 = selectedFile.name;
trace("File Upload 1: "+_global.filename1);
}

function uploadImage(event:Object):Void {
imageFile.browse([{description: "Image Files ", extension: “.jpg;.gif”}]);
}

choose_picture.onPress = uploadImage;
;(;(;(;(;(