3-Tier Upload in ASP


FileUpEE can perform a browser-to-server-to-server (3-tier) upload, allowing you to maintain a secure file server that is isolated from your public web server.

The client-to-server part of the file transfer is a form-based file upload . This type of upload submits form data (the file and/or other form elements) as name/value pairs. FileUpEE processes the upload on the web server.

FileUpEE submits the server-to-server part of the file transfer as a SOAP message with an attachment . SOAP (Simple Object Access Protocol) is an Internet protocol that uses HTTP as its transport and XML as its data format. A SOAP request is submitted in an XML document (the XML payload) via HTTP. Unlike a form-based upload request - which can only include name/value pairs - the XML payload can contain a much richer, hierarchical set of data.

When scripting a 3-tier upload, you can include all upload processing instructions on the Web server, as you would in a client-to-server upload. If the request from web server to file server includes all processing instructions, these can be executed automatically on the file server. Alternatively, you can put the processing instructions on the file server, to protect important paths and database information.

To allow file uploads, NTFS permissions must be set appropriately for FileUpEE's temporary and destination directories. For more information, see Security Considerations.

Uploading a File from Client to web Server to File Server

The following ASP tutorial demonstrates 3-tier uploading with FileUpEE. The tutorial's application uploads a file from a web form. The file is first sent to a Web server, and then to a file server, where it is saved. All upload processing directions (such as the destination directory) are in the web server page. These directions are executed by FileUpEE on the file server if automatic file processing is selected (as it is in the following tutorial).



The Client-Side Code

The client-side page defines a web form that is used to upload the file from the client to the web server. The web form submitting the file must contain:

The web Server Code

The web server page includes all upload processing directions: the save method (FileUpEE can save to either a directory or a database), save location, and other properties. FileUpEE sends the upload request from the web server to the file server page specified by the TargetUrl property. The upload request from web server to file server is a SOAP message with an attachment. The SOAP request (an XML file) contains all the processing directions specified on the web server. These directions are executed by FileUpEE on the file server if automatic file processing is selected (as it is in the following tutorial).

The following VBScript lines receive the upload on the web server, set instructions to be executed on the file server (the upload's final destination), and send the upload (as a SOAP request) to the file server:

The File Server Code

The file server code does not include upload processing instructions, because it automatically executes the instructions that were set on the web server and sent to the file server as a SOAP request.




Avoid Errors by Using Typelibs

In ASP, Typelibs provide quick and convenient access to constants associated with a particular object. The web server script in this example includes FileUpEE's TypeLib because the script uses constants (e.g, saWebServer). The UUID attribute specifies FileUpEE's unique identifier.

<!--METADATA TYPE="TypeLib" UUID="{6B16F98B-015D-417C-9753-74C0404EBC37}"-->

Top

Copyright © 2010 SoftArtisans, Inc. All rights reserved.