dangeorge6 Posted February 15, 2007 Share Posted February 15, 2007 I've reached a brickwall trying to upload a file. The following function is called to upload an mp3 and insert into the database: function addSongs(){ require('globals.php'); $email = $_SESSION['Email']; //if file uploaded successfully... if ($_FILES['Filedata']['name']) { $uploaddir = '/var/www/uploads/#MYURL#/mp3s'; $profile_id = $_SESSION['profile_id']; $pathname = basename($_FILES['Filedata']['name']); $query_addsongs = "INSERT INTO $SQL_MP3_TABLE (profile_id, mp3path) VALUES ('$profile_id', '$pathname')"; mysql_query($query_addsongs) or die(mysql_error()); move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploaddir . basename($_FILES['Filedata']['name'])); //upload mp3 } } The correct path name inserts into the database, so I know that it sees $_FILES['Filedata']['name'], it just doesn't move the uploaded file into the /mp3 folder. I tried changing permissions on the mp3 folder and the folder this script is contained to 777 on my Unix box. Any ideas? Thanks Link to comment https://forums.phpfreaks.com/topic/38686-trouble-uploading/ Share on other sites More sharing options...
dangeorge6 Posted February 16, 2007 Author Share Posted February 16, 2007 bump Link to comment https://forums.phpfreaks.com/topic/38686-trouble-uploading/#findComment-186026 Share on other sites More sharing options...
corbin Posted February 16, 2007 Share Posted February 16, 2007 What's in globals.php? And try if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploaddir . basename($_FILES['Filedata']['name']))( { echo "success"; } To see if it thinks it's moving the files. Link to comment https://forums.phpfreaks.com/topic/38686-trouble-uploading/#findComment-186027 Share on other sites More sharing options...
dangeorge6 Posted February 18, 2007 Author Share Posted February 18, 2007 globals is just a bunch of global variables and the mySQL connect. I tried that code and it doesn't work. So, I know that $_FILES['Filedata']['name'] is the name of the file to upload, it just won't move the file. I should also add that the uploading takes place in a Flash 8 movie using the FileReference actionscript class. Link to comment https://forums.phpfreaks.com/topic/38686-trouble-uploading/#findComment-188156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.