0

I have the simplest code possible to upload a file using php and it only doesnt work using mozilla firefox.
The server responds: 'Bad Request Your browser sent a request that this server could not understand.'

This is the code(2 files):
upload_file0.php

<html>
<body>

<form action="upload_file.php" 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>

upload_file.php

<?php
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"];
  }
?>

Any answer will be truly appreciated.
Thanks

2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by vibhaJ
0

Thanks vibhaj,

I already done that and it didnt work.

I have something to say that might be important:
when i upload on firefox small files of a few kb's it works, the upload works.
But when i use files a little bigger like 800 kb i have the same problem.
The problem is that with firefox the uploads are slower, and im guessing that the server must have a timeout
for uploading files. How do i get this timeout disabled i just dont know.

Any clues ??

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.