Microsoft Form Behavior

When we started designing ABCUpload we didn't want to forget that file upload is just another form operation. Microsoft should have supported file upload within their standard Form object. Given that they didn't, our replacement should be as similar as possible to the original, just adding in new file fields in a sensible way. We've been very fussy about this issue because often it's the smallest differences that lead to confusion. There are some surprisingly complicated parts to these seemingly simple objects and many developers cut corners.

So our XForm object is designed to be used in exactly the same way as a standard Request.Form object. Any code you write to access fields within a standard form should transfer directly to accessing fields within a multipart form. Obviously we've had to add some extra functionality to allow special file operations but this is added functionality and doesn't affect the basic operations in any way.

The upshot of this is that it is easy to learn how to use ABCUpload. You can move between standard forms and upload forms with minimal changes in code. For example the following code writes out the contents of all the fields in a form using the standard Microsoft Form object.

Set theForm = Request.Form
For Each Item In theForm
  Response.Write Item & "<br>"   For Each subitem In theForm(Item)     Response.Write " - " & subitem & "<br>"   Next Next

While the following is the equivalent code using ABCUpload.

Set theForm = Server.CreateObject("ABCUpload.XForm")
For Each Item In theForm
  Response.Write Item & "<br>"
  For Each subitem In theForm(Item)
    Response.Write " - " & subitem & "<br>"