Jump to content
php.lv forumi

uploadojot mp3 kļūda


xfr33

Recommended Posts

Labdien!

Tatad pie mp3 uploada, fails netiek uploadots. Ir divi varianti - ja uploads veiksmīgs, tad parāda, ka ielādējas, bet ja nav, tad raksta kļūda. Un visu laiku raksta kļūda.

 

Faila kods:

 

<?php

session_start();

     $upload_path = './songs/'; // The place the files will be uploaded to (currently a 'files' directory).
  $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).


if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)){
echo "Ieladejas";	
}else{
echo "Kluda";	
}

?>

 

Un no iepriekšējās lapas, kur ir pati forma

 

if(isset($_SESSION['username'])){	
echo "<form action=\"./mp3_upl2.php\" method=\"post\" enctype=\"multipart/form-data\">
<br /><br />Augšupielādē savu dziesmu šeit!<br /><br />
    Autors: <br />
 <input type=\"text\" name=\"author\" /><br />
 Dziesmas nosaukums: <br />
 <input type=\"text\" name=\"title\" /><br />
 Dziesmas fails(mp3 formātā):<br />
 <input type=\"file\" name=\"userfile\" id=\"file\" /> <br />
 <input type=\"submit\" value=\"Ieladet\" />
</form>";
}else{

 

 

Kāds var palīdzēt ar šo problēmu?

Edited by xfr33
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...