Well, basically I'm trying to upload an mp3 file to a folder I created from the server, but I've done everything myself, and I always end up with the same error. Here's the code:
<?php
include("connectsql.php");
isset($_GET ['mp3file']) ? $_GET['mp3file'] : '';
$songname = $_GET['songname'];
$query = "SELECT id FROM songs WHERE Song = '$songname'";
$result = mysqli_query($link, $query) or die(mysqli_error($link));
$uploaddir = 'http://localhost/sitededownload/musicas/';
$uploadfile = $uploaddir . basename($_FILES['mp3file']["name"]);
if($result){
$nomemusica = mysqli_fetch_assoc($result);
}
echo "<pre>";
if (move_uploaded_file($_FILES['mp3file']["name"], $uploadfile)) {
echo "Arquivo válido e enviado com sucesso.\n";
}else {
echo "Possível ataque de upload de arquivo!\n";
}
PRINT_R($_FILES);
echo "</pre>";
?>
and this is the result of PRINT_R:
Possível ataque de upload de arquivo!
Array
(
[mp3file] => Array
(
[name] => I Feel It Coming.mp3
[type] =>
[tmp_name] =>
[error] => 1
[size] => 0
)
)
Any solution?