Need some help with my upload script
Posted: Sat Jun 07, 2008 12:08 pm
Hey guys,
New here, and new to PHP. Im a flash developer, and a client wants to be able to upload mp3's thru his flash...
I had this script working before, but I tried to add a rename function to put the users name before the track, and since then I can't get it to work at all..
Any ideas? The flash says that it finishes only when I comment out the rename script...but it doesn't show up in the DIR. It was working before, but I can't figure this out...
Thanks so much!
New here, and new to PHP. Im a flash developer, and a client wants to be able to upload mp3's thru his flash...
I had this script working before, but I tried to add a rename function to put the users name before the track, and since then I can't get it to work at all..
Code: Select all
<?php
//create the directory if doesn't exists (should have write permissons)
if(!is_dir("./files")) mkdir("./files", 0755);
//move the uploaded file
move_uploaded_file($_FILES['Filedata']['tmp_name'], "files/".$_FILES['Filedata']['name']);
//rename("files/".$_FILES['Filedata']['name'], "files/".$_GET['name']."_".$_FILES['Filedata']['name']);
chmod("files/".$_FILES['Filedata']['name'], 0777);
?>Thanks so much!