PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Terriator
Forum Commoner
Posts: 60 Joined: Mon Jul 04, 2005 12:46 pm
Post
by Terriator » Mon Aug 01, 2005 5:48 am
Hey,I was trying to make a script so that I could upload mp3's to the server...This is basically what I've got so far:
Code: Select all
if($_GET['page']==upload){
echo"<center><h1>Upload Musik</h1><br>
<FORM ACTION='features.php?page=upload_now' METHOD='POST' enctype='multipart/form-data'>
<b>Navn på nummer: </b><INPUT TYPE='TEXT' NAME='headline' size='20' /><br><br>
<b>Find filen: </b><input type='file' name='file'><br><br>
<input TYPE='submit' VALUE='Upload'/>
</FORM>
</center>";
}
//Do upload file
if($_GET['page']==upload_now){
//Target path
$target_path = "musik/";
//Upload
$filename = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
copy($_FILES['file']['tmp_name'], '../musik/'.$_FILES['file']['name']) or die ('Could not upload');
echo"<center><br><b><u>Musikfilen er oploadet</u></b><br><a href='index.php?page=index'>Klik her for at tilbage til administratormodulet</a><br><br></center>";
}
It works fine with pictures and stuff, but I can't upload other files such as musik?
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Mon Aug 01, 2005 5:59 am
<input type="hidden" name="MAX_FILE_SIZE" value="9999999999999999">
replace the 9's in the value with the max amount of bytes that you want allowed to be uploaded
Liquidant
Forum Newbie
Posts: 3 Joined: Mon Feb 20, 2006 11:21 am
Post
by Liquidant » Mon Feb 27, 2006 2:25 pm
could that be changed to set the max bit rate instead.
I need to check that the bit rate is 128kbps or below before I allow anyone to upload
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 27, 2006 2:29 pm
Nope. You will have to process the file once it is uploaded.
and ooooold thread.