Transactional Upload

With SA-FileUp 3.0, you can control the upload transaction using the Microsoft Transacton Server (MTS). If the transaction aborts, the file or files are deleted and the process is rolled back.

Transactions are logged within the "Transaction Statistics" section of MTS from the Microsoft Management Console.

MTS can only be used in Win NT Web Servers. It is not included with Personal web server for Win95.

To useSA-FileUp within MTS, you must have SA-FileUp installed as a package. You should have set SA-FileUp up as a package in MTS when you first installed it. To verify this, open the MTS Explorer and look for SA-FileUp in the list of installed packages.

If SA-FileUp is not installed as a package, double click the "SAFILETXInstall.VBS" file that is included in the installation directory for SA-FileUp.

How to set ASP as a transactional page

On the response page, you need to indicate that you are using MTS. Include the following line at the top of the page:

	<%@ LANGUAGE="VBSCRIPT" TRANSACTION = Required %>

Throughout your script, you can apply error handling with "ObjectContext.SetAbort", to control the transaction. For example:

....
<% if upl.IsEmpty = 1 Then
	'---Abort upload if file is empty.
	ObjectContext.SetAbort
%>
....

To display whether the transaction was committed or aborted, you can use the following subroutines:

<% 
'--- Message appended to page if upload is a failure.
Sub OnTransactionAbort
	Response.Write("<BR><hr><font color='red'><b>Transaction has been aborted.</b></font>")
End Sub%>

<%
'--- Message appended to page if upload is successful	
Sub OnTransactionCommit
	Response.Write("<BR><hr><font color='Green'><HR>Transaction has been committed.</b></font>")
End Sub
%>

See the samples provided as part of the distribution for examples of uploading one file as well as multiple files. For information about the samples provided, see Programmer's Samples.

 

 

Previous Page Next Page