We are in UAT phase of a critical project and cannot release to the client for testing becuase of this problem. Can anyone suggest a solution:
When user selects Save to Disk option on our site, this puts files from a database to a location on the web server. The File Downloader (version 2.0.10) component is then invoked and should fetch the file list. But the file list pop-up does not display at all. As a result we cannot download files to the user PC.
The license is properly registered.
NB: This code is working 100% in the QA environment (which does not use HTTPS). Also, we use Image Uplader (version 5) on this site with no issues.
Code snippet below:Extract from FileDownloader.aspx
Javascript Function to handle FileDownloader Steps:
function FileDownloader_DownloadStep(Step)
{
var htxtSessionFolderPath = document.getElementById("htxtSessionFolderPath");
//The file list is going to be downloaded
if (Step == 2)
{
//Change the path to the server script if necessary
getFileDownloader("FileDownloader").setFileList("./GetFileList.aspx?SessionFolderPath=" + htxtSessionFolderPath.value);
}
else if (Step == 11)
{
window.location.href = "DeleteFileList.aspx?SessionFolderPath=" + htxtSessionFolderPath.value;
}
else if (Step == 1)
{
window.close();
}
}
HTML code to display FileDownloader control:
<script type="text/javascript">
//Create JavaScript object that will embed File Downloader to the page
var fd = new FileDownloaderWriter("FileDownloader", 122, 44);
//For ActiveX control full path to CAB file (including file name) should be specified
fd.activeXControlCodeBase = "../FileDownloader2.cab";
fd.activeXControlVersion = "2,0,10,0";
//Set the Download button text
fd.addParam("ButtonDownloadText", "Download files");
//Set license key
fd.addParam("LicenseKey", "73020-2AB8A-00000-0AFD8-92C29;73020-10000-97D4E-A97DD-03D7A");
//The following listener will perform some actions when the file list is about to be downloaded
fd.addEventListener("DownloadStep", "FileDownloader_DownloadStep");
//The following listner will be raised when the whole download process is completed.
fd.addEventListener("DownloadComplete", "FileDownloader_DownloadComplete");
//fd.addEventListener("Error", "onError");
//Tell File Downloader writer object to generate all necessary HTML code to embed File Downloader into the page
fd.writeHtml();
</script>
Extract from GetFileList.aspx.csCode behind to generate file list for Downloader:
strBasePath = Server.MapPath("");
strBasePath = strBasePath + "\\";
Response.ContentType = "text/plain";
Response.Charset = "UTF-8";
//Check if the selected subfolder exists
if (Directory.Exists(strBasePath + strFolderPath))
{
DirectoryInfo objDir = new DirectoryInfo(strBasePath + strFolderPath);
//Iterate through all files in the subfolder and build a file list
foreach (FileInfo objFile in objDir.GetFiles())
{
if (objFile.Name.Contains(Request.QueryString["SessionFolderPath"]))
{
//Add the MIME type, the size, and the name for saving
Response.Write("*/* | " + objFile.Length + " | " + objFile.Name + " | ");
//Add the URL to the file and the CRLF combination
Response.Write(EncodeFileName(objFile.Name) + "\r\n");
}
}
}