drisate Posted May 6, 2008 Share Posted May 6, 2008 Hey guys. I am currently making an mp3 shop for a cd distributor and i am having a problem with the mp3 upload and manipulation. When i try to download the mp3 after uploading it to $upload_dir.$file_name i get a (Can't open /www/admin/site/realmp3/60sec.mp3: Permission denied) message in my FTP ... and i get a 0 sized file that failes to open. When i check in my FTP i can see the good normal size. It's like apache was bloking me to touch that file ... if (move_uploaded_file($_FILES['mp3_'.$i]['tmp_name'],$_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$file_name)){[...] Quote Link to comment https://forums.phpfreaks.com/topic/104465-upload-then-download-problem-file-bloked/ Share on other sites More sharing options...
BlueSkyIS Posted May 6, 2008 Share Posted May 6, 2008 what are the permissions on the file after the upload? you may need to chmod the file to download it via FTP. Quote Link to comment https://forums.phpfreaks.com/topic/104465-upload-then-download-problem-file-bloked/#findComment-534796 Share on other sites More sharing options...
drisate Posted May 6, 2008 Author Share Posted May 6, 2008 Yeah thats what i tryed let me post ya the code if (move_uploaded_file($_FILES['mp3_'.$i]['tmp_name'],$_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$file_name)){ chmod($upload_dir.$file_name, 755); $mp3 = new mp3($upload_demo_dir.$filename); $mp3_1 = $mp3->extract(0,30); $newname=rand("100000", "999999"); $mp3_1->save($upload_demo_dir.$newname.$filename.'.mp3'); $insert=mysql_query("INSERT INTO `distadp_adpsite`.`artiste_mp3` (id, nom_mp3, nom_demo, num_albume)VALUES (NULL , '".$_FILES['mp3_'.$i][name]."', '$newname.mp3', '$_GET[id]')"); echo "MP3 numéro $i uploadé!.<br>"; }else{ echo "Il ya eu une éreure inconnu dans le transfère du fichier du mp3 num $i<br>"; } The chmod($upload_dir.$file_name, 755); did not solve the problem ... it looks like if i was not the unix owner of the file ... Last time i saw something like that it was with a joomla installation ... Quote Link to comment https://forums.phpfreaks.com/topic/104465-upload-then-download-problem-file-bloked/#findComment-534797 Share on other sites More sharing options...
drisate Posted May 6, 2008 Author Share Posted May 6, 2008 I just noticed the chomod is not working... looks like once it's uploaded, the file is 363 and teh chomod after the move_uploaded_file is bloked Quote Link to comment https://forums.phpfreaks.com/topic/104465-upload-then-download-problem-file-bloked/#findComment-534802 Share on other sites More sharing options...
drisate Posted May 6, 2008 Author Share Posted May 6, 2008 I found the prob i had to use chmod($_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$file_name, 0755); Quote Link to comment https://forums.phpfreaks.com/topic/104465-upload-then-download-problem-file-bloked/#findComment-534805 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.