Forum » Pomoč in nasveti » problem pri uploadanju avdio fajla- PHP
problem pri uploadanju avdio fajla- PHP
AglioAlio ::
Lep pozdrav!
Imam sledeč problem.
V Phpju sem naredil stran, kjer lahko uploadam slike in glazbo (mp3, wav). Ko odprem sliko mi zaigra glasba. Problem je v tem da ne morem uploadat mp3-jev večjig kot 1MB,čeprav je maksimalna velikost fajla 10MB. S slikami pa ni težav (ista koda)
prilaagm kodo:
form enctype="multipart/form-data" action="uploader.php" method="POST"
input type="hidden" name="MAX_FILE_SIZE" value="10000000"
div align="right">Choose a file to upload:
input name="uploadedPhoto" type="file" style="slide"
input type="hidden" name="M_F_S" value="10000000" align="right">Select audio file:
nput name="uploadedAudio" type="file" style="slide"
input name="submit" type="submit" value="Upload File"
pa se PHP koda:
$target_pathP = "uploads/";
$target_pathA = "uploads/";
//Add the original filename to our target path. Result is "uploads/filename.extension"
$target_pathP = $target_pathP . basename( $_FILES['uploadedPhoto']['name']);
$target_pathA = $target_pathA . basename( $_FILES['uploadedAudio']['name']);
if(move_uploaded_file($_FILES['uploadedPhoto']['tmp_name'], $target_pathP)){
if(move_uploaded_file($_FILES['uploadedAudio']['tmp_name'], $target_pathA)) {
$query= "INSERT INTO tablephoto VALUES ('','$target_pathP','$target_pathA ','$description','$ime')";
echo "The file ". basename( $_FILES['uploadedPhoto']['name']). " has been uploaded";
mysql_query($query);
}
else{
echo"There was an error uploading the audio file, please try again!";
}
} else{
echo "There was an error uploading the photo file, please try again!";
}
Imam sledeč problem.
V Phpju sem naredil stran, kjer lahko uploadam slike in glazbo (mp3, wav). Ko odprem sliko mi zaigra glasba. Problem je v tem da ne morem uploadat mp3-jev večjig kot 1MB,čeprav je maksimalna velikost fajla 10MB. S slikami pa ni težav (ista koda)
prilaagm kodo:
form enctype="multipart/form-data" action="uploader.php" method="POST"
input type="hidden" name="MAX_FILE_SIZE" value="10000000"
div align="right">Choose a file to upload:
input name="uploadedPhoto" type="file" style="slide"
input type="hidden" name="M_F_S" value="10000000" align="right">Select audio file:
nput name="uploadedAudio" type="file" style="slide"
input name="submit" type="submit" value="Upload File"
pa se PHP koda:
$target_pathP = "uploads/";
$target_pathA = "uploads/";
//Add the original filename to our target path. Result is "uploads/filename.extension"
$target_pathP = $target_pathP . basename( $_FILES['uploadedPhoto']['name']);
$target_pathA = $target_pathA . basename( $_FILES['uploadedAudio']['name']);
if(move_uploaded_file($_FILES['uploadedPhoto']['tmp_name'], $target_pathP)){
if(move_uploaded_file($_FILES['uploadedAudio']['tmp_name'], $target_pathA)) {
$query= "INSERT INTO tablephoto VALUES ('','$target_pathP','$target_pathA ','$description','$ime')";
echo "The file ". basename( $_FILES['uploadedPhoto']['name']). " has been uploaded";
mysql_query($query);
}
else{
echo"There was an error uploading the audio file, please try again!";
}
} else{
echo "There was an error uploading the photo file, please try again!";
}
dolegar ::
Po čem sklepaš, da je max velikost 10MB po MAX_FILE_SIZE?
Naredi enp phpinfo datoteko in jo naloži na server potem pa poglej
- post_max_size
- upload_max_filesize
oz. ,da ti pri večjih datotekah ne "timeout-a" skripta (30 sekund) razen, či nisi časa že povečal.
Naredi enp phpinfo datoteko in jo naloži na server potem pa poglej
- post_max_size
- upload_max_filesize
oz. ,da ti pri večjih datotekah ne "timeout-a" skripta (30 sekund) razen, či nisi časa že povečal.
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [JS / PHP] miniajax postOddelek: Programiranje | 1031 (765) | cobrica |
» | Pomoč pri nalaganju večih slik naenkratOddelek: Izdelava spletišč | 834 (684) | winlins |
» | php $_FILE in praviceOddelek: Izdelava spletišč | 728 (655) | psychoP |
» | [php] unlink - problemčekOddelek: Izdelava spletišč | 1739 (1285) | PaX_MaN |
» | Unattended install for Windows - beginnerOddelek: Operacijski sistemi | 1219 (1172) | TitanSLO |