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

upload file is not working

P: 1
below code give me the error when click the submit button

Array ( [submit] => Submit ) Error: 1

but the same code running on diff machine.can any body tell me the what is the problem


<html>
<body>

<form action="" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>

<?php
//phpinfo();
if(isset($_POST['submit']))

{
print_r($_POST);
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
}
?>
Nov 21 '11 #1
Share this Question
Share on Google+
1 Reply


zorgi
Expert 100+
P: 431
What do you mean by "diff machine" ?

Is your script running on different servers or you accessed same server from different computers. In any case it probably has something to do that file you are trying to upload is exceeding maximum set in your php.ini for upload_max_filesize
Nov 21 '11 #2

Post your reply

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