By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

Error uploading files

P: 60
if(empty($_POST)){ ?>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="10240000">
Archivo: <input type="file" name="arch"><br><br>
<center><input type="submit" value="Subir Archivo"></center>
</html> <?

$rn = $_FILE['arch']['name'];
$tn = $_FILE['arch']['tmp_name'];

if(move_uploaded_file($tn, $rn)){
echo "Archivo "."<b>".$rn."</b>"." subido";
echo "Error al mover archivo ".$tn;
echo "Error al subir archivo";


why doesn't it uploads the file i select ???

it always prints Error al "subir archivo"

in php.ini the maxsize is 32MB so that isn't the problem
May 28 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 5K+
P: 5,821
Try using:

Expand|Select|Wrap|Line Numbers
  1. print_r($_FILE);
To make sure the file was uploaded properly. Especially pay attention to the 'error' index. You can look up the error code here.
May 28 '07 #2

P: 60
thanks, but the problem was very stupid:

$_FILE xD --> while it should be $_FILES
May 30 '07 #3

Expert 5K+
P: 5,821

Yes. That problem should be ashamed of itself!


*grumble* wow HOW did I miss that one???
May 31 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.