Hello,
I am using a custom progress area after a process which processes a file and then allows the user to download the file. I am able to display the progress area however it does not disappear once the file is ready for download. I have tried using the client-side 'hide' function and 'cancelReqeust' function however they do not work. Attached is the code to generating the file and updating the progressArea:
Thanks,
David
I am using a custom progress area after a process which processes a file and then allows the user to download the file. I am able to display the progress area however it does not disappear once the file is ready for download. I have tried using the client-side 'hide' function and 'cancelReqeust' function however they do not work. Attached is the code to generating the file and updating the progressArea:
public void ExportClicked(string mappedBinPath, string mappedImagePath) |
{ |
ArrayList getFilesToProcess2 = new ArrayList(); |
getFilesToProcess2 = GetFilesToProcess(); |
if (getFilesToProcess2 == null) |
{ |
return; |
} |
// We want the client-side to recognize the upcoming file as a zip file. |
_view.PageResponse.ContentType = "application/exe"; |
_view.PageResponse.AddHeader("Content-Disposition", "attachment; filename=CMIS.exe"); |
XceedSfxPrefix sfx = new XceedSfxPrefix(new DiskFile(mappedBinPath + "xcdsfx32.bin")); |
sfx.DialogStrings[DialogStrings.Title] = "Crown Managment Information System Extraction utility"; |
sfx.DialogMessages[DialogMessages.Introduction] = "Crown Managment Information System Extraction utility. Please click 'Continue' to proceed extracting case files to your computer."; |
sfx.DefaultDestinationFolder = @"C:\"; |
sfx.ExistingFileBehavior = ExistingFileBehavior.OverwriteAlways; |
Icon ico = new Icon(mappedImagePath + "ontario.ico"); |
sfx.Icon = ico; |
// We will zip directly in the response stream. The temporary compressed |
// data will be written to the ZipArchive's TempFolder, thus the MemoryFolder |
// we set in Application_Start. |
ZipArchive destination = new ZipArchive(new StreamFile(_view.PageResponse.OutputStream)); |
destination.BeginUpdate(); |
getFilesToProcess2.Sort(); |
ArrayList refineProcessList = RefineProcessList(getFilesToProcess2); |
_view.Progress["SecondaryTotal"] = refineProcessList.Count.ToString(); |
foreach (int file in refineProcessList) |
{ |
_view.Progress["CurrentOperationText"] = file.ToString(); |
AddFolderAndFiles(dmConnection.DmDocumentSecurityToken, dmConnection.DmLibraryName, file, destination, "", new ArrayList()); |
_view.Progress["SecondaryValue"] = refineProcessList.IndexOf(file).ToString(); |
string test2 = _view.StringClientScript; |
} |
_view.Progress["CurrentOperationText"] = "Completed"; |
string test1 = _view.StringClientScript; //calls javascript hide() function |
destination.SfxPrefix = sfx; |
destination.DefaultCompressionMethod = Xceed.Compression.CompressionMethod.Deflated; |
destination.EndUpdate(); |
// And finally we zip in a single operation. If we had to zip more than |
// one source, we could have used ZipArchive.BeginUpdate/EndUpdate. |
ArrayList nameFilters = new ArrayList(); |
_view.PageResponse.End(); |
} |
Thanks,
David