Here Is a sample upload script. But I cant upload any audio or video script with this script. Please help me i want to upload all supported audio file and at the same the add to database...Please help Me. <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } //Insert into database $my_insert = mysql_query("insert into song_detail (song_ID,song_Title,description, user_id,album_ID,music_category_ID,singer_ID,song_name,song_Path,add_date) VALUES ('','$song_title','$song_description','$user_id','$album_id','$music_category_id','$singer_id','$song_title','$filepath','')") or die(mysql_error());
What is the error exactly? Files with small sizes are ok? Maybe you just have to setup the upload limit and max post size limit in the php.ini file.
No there is no error massege. Data insert in database but no file uploaded in upload folder. Thanks For Reply.
np. has write right for the directory? set 0777 right. and try it with small file firstly. is path ok? (the code looks like good)
If everything allright, I think delete the MAX_FILE_SIZE hidden tag and must be work. (By the way put the SQL insert into the IF statement, because don't save the failed uploads)
Interesting. Write this before move_uploaded_file: die(print_r($_FILES)); Code (markup): You can check the 'error' value here: http://www.php.net/manual/en/features.file-upload.errors.php Or maybe your webserver or php settings are wrong.
>>Is there any free software for upload a audio file in php? Try this script: PHP email form with file attachment * Make sure the upload folder has write access
You must have the default max_upload_size value in your php.ini. Perhaps 2 or 4M or something? Increase to 8 or 16M. Regards, Dennis M.
There is a ready and working Upload script at http://www.1afm.net/scripts/indexf.php ,check under the File MGMT category. Tell me if it helps,I can recommend more options for you
I use the same script, but my web site allows member to subscribe. How could I display each member's photo on their respective profile page? Thanks in advance.