Jump to content

Upload then download problem ... file bloked?


drisate

Recommended Posts

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)){[...]

Link to comment
Share on other sites

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 ...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.