1

Now, I am getting another problem. I am trying to upload file with this code :-

<form action="up.php" method="post">
    <input type="hidden" name="MAX_FILE_SIZE" value="200000" />
    Choose a file to upload: <input name="uploadedfile" type="file" /><br />
    <input type="submit" name="submit" value="Upload!"/>  
</form>

Here is the up.php:-

if(!isset($_FILES["uploadedfile"])) die("No file found");

In the above code, it says "No file found". why isn't it having the file?

0

3 Answers 3

2

You need to add enctype="multipart/form-data" in your form.

<form action="up.php" method="post" enctype="multipart/form-data">
Sign up to request clarification or add additional context in comments.

2 Comments

wow.. it worked... but what's the use of the enctype thing... and what does it mean? Thanks :)
It's require to send encoded data from form. You can have detail information here
2

Add enctype="multipart/form-data" to form tag

<form action="up.php" method="post" enctype="multipart/form-data">
  <input type="hidden" name="MAX_FILE_SIZE" value="200000" />
  Choose a file to upload: <input name="uploadedfile" type="file" /><br />
  <input type="submit" name="submit" value="Upload!"/>
</form>

Comments

2

Add enctype in your form tag.

<form action="up.php" method="post" enctype="multipart/form-data">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.