Page 1 of 1

Mp3 upload

Posted: Mon Aug 01, 2005 5:48 am
by Terriator
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?

Posted: Mon Aug 01, 2005 5:59 am
by shiznatix
<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

Posted: Mon Feb 27, 2006 2:25 pm
by Liquidant
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

Posted: Mon Feb 27, 2006 2:29 pm
by nickman013
You can try these.

:arrow: http://ffmpeg-php.sourceforge.net/
:arrow: http://www.bloodys.com/phpscripts.php

Thats if you want to use someone elses scripts though.

Posted: Mon Feb 27, 2006 2:29 pm
by feyd
Nope. You will have to process the file once it is uploaded.

and ooooold thread.