How To Write the FORM Tag Correctly for Uploading Files?

Ads
 

How To Write the FORM Tag Correctly for Uploading Files?

How To Write the FORM Tag Correctly for Uploading Files?

View Answers

November 12, 2010 at 4:04 PM

Write like this in ur programe


November 13, 2010 at 4:28 PM

Hi,

The "html" form code for uploading file is:

<html>
<body>

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

</body>
</html>

The uploadfiles.php code is:

<?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 "" . $_FILES["file"]["tmp_name"];
  }
?>

Thanks

Ads









Related Tutorials/Questions & Answers:
How To Write the FORM Tag Correctly for Uploading Files?
FORM Tag Correctly for Uploading Files.
Advertisements
how to write a jsp form using html
uploading image in the form
The form tag
HTML5 form example, How to implement form tag in html document.
Form Tag library configuration
HTML -- form tag.
How to create simple HTML Form?
Uploading file in servlet from a html form
Assign value from a <bean:write> tag to a variable
How to write Java Program
How to write in File in Java
how to get UIView by tag
How to write in File in Java
how to write code for this output?
How to write image in Jmagick
How to Write to file in Java?
How to write into CSV file in Java
how to write this program
How to create form in Swings
How to write text on image
How to reset a form in jQuery?
How to write calculator in J2ME program?
how to write servlet program in eclipse?
how to write store procedure in sql
how to use image tag in jsp
How to write to file using FileOutputStream
How to Write To File BufferedWriter in Java
how to write to file at the end of the line
how to write file from FileInputStream

Ads