Html/PHP upload form help?

  • Thread starter Thread starter Jus10
  • Start date Start date
J

Jus10

Guest
Could someone give me the code for one of those BUT I want it to have the coding so that people can only upload audio files (.wav .mp3 ect)
Please help me!
Also I know you can do it in the php but I want it so that when the window comes up where they browse their computer for the file to upload where it says the file type (default set to all files) i want to to have the ones I want
 
<html>
<form method="POST" enctype="multiprt/formdata">
<input type="file" name="uploadfile">
<input type="submit" name="click">
</form>
</html>
<?php
if ($_POST['click']) {
$target = 'uploads/'.$_POST['uploadfile']['name'];
if (move_uploaded_file($_POST['uploadfile']['tmp_name'],$target)) {
echo("success");
} else {
echo("failed");
}
}
?>
 
Back
Top