Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP FORM Tag Correctly for Uploading Files.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
FORM Tag Correctly for Uploading Files.
1 Answer(s)      4 years ago
Posted in : PHP


How To Write the FORM Tag Correctly for Uploading Files?


Advertisement
View Answers

December 27, 2010 at 3:47 PM


Hi friends,

When you clicks the submit button, files specified in the <INPUT TYPE=FILE...> will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written <FORM...> tag as:

  <FORM ACTION=receiving.php METHOD=post ENCTYPE=multipart/form-data>

Note that you must specify METHOD as "post" and ENCTYPE as "multipart/form-data" in order for the uploading process to work. The following PHP code, called logo_upload.php, shows you a complete FORM tag for file uploading:

How To Write the FORM Tag Correctly for Uploading Files?

    <?php
      print("<html><form action=file_uploading.php"." 
       method=post enctype=multipart/form-data>\n");
      print("<b>Please submit an image file</b> "."<br>\n");
      print("<input type=file name='imageFile'><br>\n");
      print("<input type=submit>\n");
      print("</form></html>\n");
    ?>

How To Get the Uploaded File Information in the Receiving Script?

    <html> 
<head> 
<title></title>
 </head> 
<?php $imageName=$_FILES['imageFile']['name']; ?>
 <?php $imageType=$_FILES['imageFile']['type']; ?> 
<?php $imageSize=$_FILES['imageFile']['size']; ?> 
<?php $imageTemFileName=$_FILES['imageFile']['tmp_name']; 
?> 
<body > 
<?php  echo "Name of file : ".$imageName."<br>";  ?>
<?php  echo "Type of file :  ".$imageType."<br>";?>    
<?php  echo "Size of file : ".$imageSize."<br>";  ?> 
<?php  echo "Tem file name : ".$imageTemFileName.
 "<br>";?> 
</body> 
</html>

Thanks...



Related Tutorials/Questions & Answers:
FORM Tag Correctly for Uploading Files.
FORM Tag Correctly for Uploading Files.  How To Write the FORM Tag Correctly for Uploading Files?   Hi friends, When you clicks the submit... a complete FORM tag for file uploading: How To Write the FORM Tag Correctly
How To Write the FORM Tag Correctly for Uploading Files?
How To Write the FORM Tag Correctly for Uploading Files?  How To Write the FORM Tag Correctly for Uploading Files
Advertisements
Uploading files
Uploading files  Hi, Please provide html code for my question. I need to insert the browsed files temporarily to text area while attaching more than one files during mailing
uploading and copying files
uploading and copying files  how can i upload and copy one file based on the given inputs and copy it from one directory to another
uploading image in the form
uploading image in the form  Hi All, I am working to build a form like railway registration form which accepts user id and password and image.../DisplayimageonJSPpageusingXML.shtml To know about file uploading using Struts2 you may go through the link, given
Uploading the multiple files
Multiple File uploading This script uploads the multiple file at a time. For uploading the multiple files at a time, first create a table as per required...; close the table, then close the form. Close the HTML file body and End the Tag
Uploading Multiple Files Using Jsp
Uploading Multiple Files Using Jsp  ... there is any request for file uploading. The request will be sent in the form... will be represented.  In our example we are uploading three files at a time so we
what are the codes for uploading and downloading files in and from database?
what are the codes for uploading and downloading files in and from database?  We are designing a student's website where they can get and post study materials. We actually need the code to upload and download files in and from
Uploading multiple files in JSP - JSP-Servlet
Uploading multiple files in JSP  Hi, I have this code in JSP for Uploading multiple files : Samples : Simple Upload... modification I need to do in the code to upload all the files attached. 
The form tag
In this tutorial, you will learn about Spring form tag
Uploading Files - Java Server Faces Questions
Uploading Files  Hello sir, I, succeeded in uploading file. But i face a problem, that i cant upload the file having size more than 1MB. So, Please give me the solution
Form Tag library configuration
In this section, you will learn about Spring form tag library and its configuration
java code for uploading a resume in a form - JSP-Servlet
java code for uploading a resume in a form  can anyone help me with the codes 4 uploading a resume in a registration form  Refer this link http://www.devsphere.com/mapping/docs/guide/upload.html Thanks Rajanikant
HTML -- form tag.
HTML -- form tag. Description : HTML provides a form tag. It takes user... within form tag. Code : <!DOCTYPE html PUBLIC "-//W3C//DTD... language</title> </head> <body> <h1>HTML form tag
Uploading file in servlet from a html form
Uploading file in servlet from a html form  Sir, I want to upload a picture from my html file and save it to my database as BLOB,but what JAR should i use for this purpose i am really confused about.And also is it possible to do
Form Tag Example
.style1 { color: #FFFFFF; } Form Tag Example  ... the form tag. The form tag is a UI tag that renders HTML an input form. The remote form allows the form to be submitted without the page being refreshed. The results
Tomahawk inputFileUpload tag
;enctype" attribute in the form tag and set to "multipart/form-data". You...Tomahawk inputFileUpload tag          File uploading
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP - JSP-Servlet
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP  I am using the following code snippet.... Is it not possible to use a image instead of normal html Browse button for uploading files
JSF form tag
JSF form tag      This tag renders html form element which contains the data that is submitted with the form. This tag uses "POST" method. The components under the particular
Comparing arrays not working correctly?
Comparing arrays not working correctly?  Comparing arrays not working correctly
HTML5 form example, How to implement form tag in html document.
HTML5 form example, How to implement form tag in html document. HTML form tag... it is use for registration , order, searching etc. Html form is a pair tag. OR Form...: Attribute of form tag provides significant information about the form
Uploading Multiple Files Using Jsp
Uploading Multiple Files Using Jsp  ... there is any request for file uploading. The request will be sent in the form... will be represented.  In our example we are uploading three files at a time so we
eliminate the extra space after a </form> tag
eliminate the extra space after a tag  How can I eliminate the extra space after a tag
In tag files,does attribute values accept expressions or not? If not please explain the reason
In tag files,does attribute values accept expressions or not? If not please explain the reason  **Actually when i do manually in tomcat server... in tag file, attribute value does not accept any expressions
The errors tag
In this section, you will learn about the errors tag of the Spring form tag library
The checkboxes tag
In this section, you will learn about checkboxes tag of Spring form tag library
The radiobutton tag
In this section, you will learn about radiobutton tag of Spring form tag library
The radiobuttons tag
In this section, you will learn about radiobuttons tag of Spring form tag library
The select tag
In this section, you will learn about the select tag of Spring form tag library
The option tag
In this section, you will learn about the option tag of Spring form tag library
The options tag
In this section, you will learn about the options tag of Spring form tag library
 

 

 

DMCA.com