xfr33 Posted July 11, 2009 Report Posted July 11, 2009 (edited) 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 July 11, 2009 by xfr33 Quote
marcis Posted July 11, 2009 Report Posted July 11, 2009 Apskaties, ko rāda $_FILES['userfile']['error'] un var_dump(is_writable($upload_path)); Quote
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.