on 10-26-2008 12:47 PM
Hi everyone,
I tried to create a File Download UI element.
Here is the code I wrote :
final IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.PDF);
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow( resource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal()),
resource.getResourceName());
window.open();
The problem is that it open 2 windows : the first is the window which asks to SAVE or to OPEN (which is OK), the second window is just an empty window (blank page).
How can I not display the second window ?
Thanks in advance.
Regards.
Hi
This code is working file for me
wdComponentAPI.getMessageManager().reportSuccess("==Before =="+FilePath);
IWDResource res = WDResourceFactory.createResource(
new FileInputStream(FilePath"
"wdContext.currentContextElement().getDirectory()
+wdContext.currentContextElement().getFileName()), wdContext.currentContextElement().getFileName(),
WDWebResourceType.DOC, true);
wdComponentAPI.getMessageManager().reportSuccess("=="+FilePath);
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(
res.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal()),
res.getResourceName());
window.show();
} catch (FileNotFoundException e) {
// ..
}
PS: May try to change window.open() to show()
Hople it will solve your problem
Thanks
Anup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
That blank window is a default window which opens up if you put FileDownloadBehaviour as ALLOW_SAVE. It has nothing to do with IE version. Try choosing AUTO or OPEN_INPLACE.
Hope it helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
As I can understand from your code you want a modal window to open up and then from that modal window the file should be downloaded....Is that corrcet?
If yes then for that write the code for getting the file resource and file download behaviour in the modal window.
Also the file download UI element should be on second window.
This should help you.
You can go through the follwoing PDF for uploading and downloading file:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can refer this PDF for file download. This is working fine for me.
I hope this may also help you.
thanx.
Edited by: saurav mago on Oct 27, 2008 6:06 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.