AspUploadAspUpload is an Active Server component which enables an ASP application to accept, save and manipulate files uploaded with a browser. The files are uploaded via an HTML POST form using the <input type=file> tag. The AspUpload component is invoked by an ASP script located on a Windows NT/2000 server running Internet Information Server (IIS). For AspUload you would need a HTML forms page. Let's create a simple HTML form which will let us upload up to three files, and a script to handle the uploading. This is the HTML file called test.asp: <html> Notice the ENCTYPE="multipart/form-data" attribute in the FORM tag. It instructs the browser to send the entire file to the server and not just the file name entered in the input text box. It is absolutely mandatory that your uploading forms contain this attribute, or no uploading can be performed. Let us now look at the corresponding uploading script uploadscript.asp: <html> The first line of the ASP script simply creates an instance of the AspUpload object. The second line calls the Save method of the component which actually does the job: it parses the posting received from the browser, figures out how many files are being uploaded, and saves them in the specified directory. All the files will be saved in the directory specified under their original names. The Save method returns the number of files successfully uploaded. In case of an error this method will throw an exception. It is important that you let us know what directory you would like the files to be uploaded so that we can set the right permissions for you on that directory. You can now go ahead and try to upload a few files. You can use any or all of the input boxes on your form. AspUpload is smart enough to figure out which input boxes are used and which are not. |
Flash Games
|
ImageAid recently completed and launched the innnagural Web site for OurayVacations.com. The site promotes vacation opportunities and activities in Ouray, Colorado, 'The Switzerland of America.' The site integrates HTML with XML and Flash, creating a usable, dynamically driven site.