[Upload] Impossible d'uploader un fichier .swf
bonjour, :D
J'ai une page ou l'on peut uploader son propre film flash.
j'usqu'a aujourd'hui tout marchait a merveille. :cry:
Maintenant les fichier ne se font plus evoyer. :bug:
voicie mes deux pages:
le form:
Code:
1 2 3 4 5 6 7 8 9
| <form action='upload.php' method='post'
enctype='multipart/form-data'>
File:<input type='file' name='file' id='file' /> <br>
Title:<input type='text' name='title' /><br>
Desc:<input type='text' name='desc' /><br>
<input type='radio' name='type' value=0 />Game<br>
<input type='radio' name='type' value=1 />Movie<br>
<input type='submit' name='submit' value='Upload' />
</form> |
et le fichier upload.php:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?php
include("config.php");
$stock = 'swf/';
$filename = basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $stock.$_FILES['file']['name']))
{
$con = mysql_connect($cfg['mysql'],$cfg['user'],$cfg['pass']);
if (!$con)
{
die('MySQL: '.mysql_error());
}
mysql_select_db("willisite", $con);
$sql = "INSERT INTO flash (title, swf, descri, type) VALUES ('".$_POST['title']."', '".$filename."', '".$_POST['desc']."', ".$_POST['type'].")";
if (!mysql_query($sql,$con))
{
die('MySQL: '.mysql_error());
}
echo "Upload of file ".$filename." completed<br><br><a href='index.php'>Go Back</a><br><br><a href='index.php?page=upload'>Upload another file</a>";
mysql_close($con);
}
else
{
echo "An unknown error occured please <a href'mailto:webmaster@wiillsite.com'>contact webmaster</a>
<br><br><a href='index.php'>Go back</a><br><br><a href='index.php?page=upload'>Try again</a>";
}
?> |
Merci