Page 1 of 1

Need some help with my upload script

Posted: Sat Jun 07, 2008 12:08 pm
by allnatural
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..

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);
 
?>
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!

Re: Need some help with my upload script

Posted: Sat Jun 07, 2008 2:20 pm
by allnatural
The client told me that any files larger than 1mb are not being uploaded...however the ones below work...any ideas?

Re: Need some help with my upload script

Posted: Sat Jun 07, 2008 5:48 pm
by califdon