<input type="file" /> displays controls that allow users to input a file. Computer users and WebTV users see very different controls. If the user is using a computer, a control for browsing is displayed. If the user is a WebTV user, either a control for taking vid caps or a control for recording wav's is displayed. To upload files, the form's method must be post and attribute enctype="multipart/form-data" must be used. To display the wav input for WebTV users, use the attribute device with the value microphone or audio. Computer users will ignore the attribute device.
<form method="post" enctype="multipart/form-data">
<input type="file" />
<input type="file" device="microphone" />
<input type="file" device="audio" />
</form>
If you are making a form WebTV users to upload vid caps or wav's, computer users can use the same form to upload anything on their computer. The server side script that handles the uploading should use regular expressions to validate the form and avoid nasty surprises. If it is a public script, you should use regular expressions or other functions to reject or alter any input with a / in it so the file will only go to the directory where you want to to go and and the file name doesn't have spaces or other illegal characters in it so you don't end up with files with invalid names in their URL.
|
|
|