Validating the file field

In both cases, you will find the control in the HTML section of the Toolbox.

The File Field control allows access to program the HTML tag.

validating the file field-17

However, there are many cases where you are going to need more than simple textual data; you may want your users to upload files to the server.For instance, your application can have a document library that is shared with all users.The File Field control uploads files to the server from the client's machine.It is important to note that this control is called the File Field control in all versions of Microsoft Visual Studio® . NET Web Matrix, this control is called the File Upload control.Listing 1 shows you how to use the File Field control to upload files to the server.

When the page from Listing 1 is run, you can select a file and upload it to the server by clicking the Upload File button on the page. With only a few lines of code, it is easy to upload any type of files to the server.This tag is used to work with file data within an HTML form.In the past when using classic ASP (ASP 3.0 or earlier), many programmers worked with third-party components to upload files from the client to the server. NET and this new control, uploading is taken care of for you—and it couldn't be simpler.Now let's take a look at how to upload multiple files to the server from a single page. NET Framework enable you to upload multiple files from a single ASP. With a little work, however, you can easily accomplish this task. This approach enables you to upload as many files as you want from a single page. NET page that has four file-input boxes and one Submit button.After the user clicks the Submit button and the files are posted to the server, the code behind takes the files and saves them to a specific location on the server.In the Properties dialog box, click on the Security tab and make sure the ASP.