This issue occurs only if the same instance of XFile is used to perform both uploading and downloading.
The XFRequest object has 2 similar but mutually exclusive properties, Response and ResponseFile. Both store the server response. ResponseFile is simply a path where the response is saved. When uploading, XFile saves the server response in the Response property. When downloading, the response is the content of the file, so ResponseFile is set to the path of the downloaded file. For further details, refer to the documentation pages for
Response and ResponseFile.
The problem is that after a download, the ResponseFile property is not reset. So for any subsequent upload, the server response will still go to the location specified by ResponseFile. This will overwrite the previous download, so it's quite a serious problem. The other side-effect is that the Response property will be empty and thus not displayed by the browser; this is usually the first symptom that alerts users to the problem.
We will resolve this issue in a future release of XFile. Fortunately, there are 2 simple workarounds, as follows:
- Create separate instances of the XFRequest object to handle uploads and downloads:
[Javascript]
|
[VBScript]
|
|
var XFileUpload = new ActiveXObject("SoftArtisans.XFRequest");
var XFileDownload = new ActiveXObject("SoftArtisans.XFRequest");
Dim XFileUpload
Set XFileUpload = CreateObject("SoftArtisans.XFRequest")
Dim XFileDownload
Set XFileDownload = CreateObject("SoftArtisans.XFRequest")
|
- Manually reset the ResponseFile property to an empty string before each upload:
XFRequest.ResponseFile = "";
|