io ho uno script per fare 1 upload.
io lavoro su altervista.
ho un proble: se il file è di piccole dimensioni ed è un file ASCII lo accetta mentre se è un file Binario come *.zip ecc. no.
xkè?avete un modo alternativo a quello che uso io???
gstdown.php
Codice PHP:

<form enctype="multipart/form-data" action="carica.php" method="POST">

<
input type="hidden" name="MAX_FILE_SIZE" value="30000" />

Send this file: <input name="userfile" type="file" />
<
input type="submit" value="Send File" />
</
form
carica.php
Codice PHP:
<?php
// Nelle versioni di PHP precedenti alla 4.1.0 si deve utilizzare $HTTP_POST_FILES anzichè 
// $_FILES.
$uploaddir '../../Download/';
$uploadfile $uploaddir basename($_FILES['userfile']['name']);
echo 
"<pre>";
if (
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo 
"File is valid, and was successfully uploaded.\n";
} else {
echo 
"Possibile attacco tramite file upload!\n"
}
?>
 <form action="query.php" method="post">
<table width="894" border="0" cellpadding="0" cellspacing="0">
  
  <tr>
    <td width="262" height="27" valign="top">Nome gioco: </td>
    <td width="632" valign="top"><input type="text" name="nome"></td>
  </tr>
  <tr>
    <td height="133" valign="top">

Descrizione:</p>
    

</p>
    

</p>
    

</p></td>
    <td valign="top"><textarea name="descrizione" cols="40" rows="10"></textarea></td>
  </tr>
  <tr>
    <td height="27" valign="top">Dimensione:</td>
    <td valign="top"><input type="text" name="dimensione" value="<?=$_FILES['userfile']['size']
?>"></td>
  </tr>
  <tr>
    <td height="27" valign="top">Path immagine: </td>
    <td valign="top"><input name="image_path" type="file"></td>
  </tr>
  <tr>
    <td height="27" valign="top">Path download </td>
    <td valign="top"><input type="text" name="download" value="<?=$_FILES['userfile']['name']
?>"></td>
  </tr>
</table>
<div align="center"><input type="submit" value="invia"><input name="reimposta" type="reset" value="reimposta"></div>
</form>
<?
print "</pre>";

?>
query.php
Codice PHP:
<?
// Nelle versioni di PHP precedenti alla 4.1.0 si deve utilizzare $HTTP_POST_FILES anzichè 
// $_FILES.
$uploaddir '../../immagini/download/';
$uploadfile $uploaddir basename($_FILES['image_path']['name']);
echo 
"<pre>";
if (
move_uploaded_file($_FILES['image_path']['tmp_name'], $uploadfile)) {
echo 
"File is valid, and was successfully uploaded.\n";
} else {
echo 
"Possibile attacco tramite file upload!\n"
}
echo 
'Alcune infromazioni di debug:';
print_r($_FILES); 

print 
"</pre>";

include(
'connection/db.php');
$Download $_POST['nome'];
$Descrizione $_POST['descrizione'];
$immagine $_FILES['image_path']['name'];
$percorso $_POST['download'];
$dimensione $_POST['dimensione'];
$MySql "INSERT INTO download (download,descrizione,immagine,percorso,dimensione) VALUES ('".$Download."','".$Descrizione."','".$immagine."','".$percorso."','".$dimensione."')";
mysql_query($Mysql);
?>Download aggiunto con successo