Newbies and Uploaders
Posted: Sun Jan 11, 2009 1:30 am
I've been trying to get a script for an uploader working - though this isn't exactly a standard uploader. It receives it's information from Flash and then transfers it to the destination folder. However, nothing I've done as of yet has gotten this thing going. I've made sure the Actionscript has the correct settings. A problem occured when I set both script and destination folder to 777 - it gave me an 500 error and refused to let me see the PHP script period.
This is the code.. something in it doesn't really feel right, but I can't put my finger on the problem:
This is the code.. something in it doesn't really feel right, but I can't put my finger on the problem:
Code: Select all
<?PHP
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['Filedata']['name']);
if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $target_path))
{
echo "The file ". basename( $_FILES['Filedata']['name']). " has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
?>