In order to download from an asp page to XFile, you will
pass, to XFile's
AddFile method, the URL of an asp download processing page, rather than the URL of the file to be downloaded. If you do not wish to hardcode which files you want to download in the server-side processing page, you can pass a querystring containing the
filename in the URL of the ASP page. Passing the filename by
querystring also allows you to use one server-side asp processing page to
download multiple files.
  The attached sample uses XFile on the client and
FileUp on the server to download
two files from a non-browsable directory on the server. In order to run this
sample, unzip xfile-fileupdownload.zip and please do the following:
  Place the files AXFFile_ASPdownload.htm,
AXFFileProgress.htm, and fileup_download.asp in a virtual directory on
the server.
  In the client-side script in AXFFile_ASPdownload.htm, modify the
following lines:
AXFFileDownload.AddFile "c:\temp\file1.txt",
"http://localhost/mycode/xfile-fileupdownload.asp?filename=file1.txt"
AXFFileDownload.AddFile "c:\temp\file2.doc", "http://localhost/mycode/xfile-fileupdownload.asp?filename=file2.doc"
For each of these AddFile lines,
make sure that the second parameter contains the complete URL to the download
processing page xfile-fileupdownload.asp on your
server. Leave the querystrings as they are. If you wish to download the files to a location on the client other than "c:\temp", also modify the first parameter to spell out the complete paths for the downloaded files on the client.
Move the directory FilesToDownload to the root of the
"C:" drive, or another location on the server. If you do not place this directory in "C:\", then you
need to modify the following line in fileup_download.asp:
filepath = "c:\FilesToDownload"
Replace the path with the physical path of the
"FilesToDownload" directory on your server.
Browse the file AXFFile_ASPdownload.htm. Click the "start download" button. |