Thursday, November 26, 2009

Tip for the day ...

To upload file in the web, `<form>` method attribute should be POST; and attribute (enctype) to be enctype="multipart/form-data". File upload tag should be <INPUT type="file" name="name_for_the_tag">

Example:-
<HTML>
<HEAD> <TITLE> Form Upload Sample</TITLE>
</HEAD>
<BODY>
....
<FORM name="form_1" action="Link_of_the_server_side_script" enctype="multipart/form-data" method="post"> <P>
What files are you sending? <INPUT type="file" name=" filename_for_the_tag">
</P>
</FORM>
....
</BODY>
</HTML>

Textfield will appear with Browse button for this, provisioning to choose the file for upload.
--
Anand
anand.sadasivam@googlemail.com

No comments: