cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable "Save" button in FileDownload Element??

Former Member
0 Kudos

Dear All,

I have an urgent case which <b>requires not to show the "Save" button in FileDownload element box</b>. I only want "Open" and "Close" button shown. How to achieve this?

thanks,

Zita Liao

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Zita,

First, this is absolutely impossible -- this is standard built-in browsers behavior and it can't be altered neither with WD nor with JavaScript.

Second, this is very esoteric requirement; I'm just wondering what your business analyst / wireframe designer smokes.

VS

Former Member
0 Kudos

Hi VS ,

This is because of security issue. I guess they only want the user to read the document on line instead of saving it to the local drive.

Do you have any idea to get to this point??

thanks,

Zita

Former Member
0 Kudos

Zita,

Then I recommend to get URL of binary resource and open it in new external window.

Also I can't understand how this can ever help security (or privacy) -- there is no problems to save Word or Acrobat document opened this way to client machine.

VS

sid_sunny
Contributor
0 Kudos

Hi Zita,

Then you can try the WDURLGenerator service to generate a URL and open it in a non modal or external window.

Regards

Sid

You got the answer probably by valery, I was a bit late.

Message was edited by:

siddharth chauhan

Former Member
0 Kudos

Thanks all,

But I use this piece of the code....and only the pdf file is opened directly.

Other types such as .doc or .ppt, the system still pops out the "SAVE" window though. How to deal with other types and let them open directly??

try{
					  IWDCachedWebResource pdfResource=WDWebResource.getWebResource
				   (out.toByteArray(),binaryType.getMimeType());
				   wdComponentAPI.getWindowManager().createExternalWindow(
					pdfResource.getURL(),"Report View",true).open();
				  }
				  catch(Exception e)
				  {
				   wdComponentAPI.getMessageManager().reportException(
				   e.getLocalizedMessage(),
				   true);
				  }

thanks,

Zita

Former Member
0 Kudos

zita,

Actually this is browser-specific. For example, Firefox never opens Word document without a dialog. Any browser doesn't open Word document if Word application is not installed (obviously).

Also I'm not sure whether it helps, try the following:

in wdDoInit invoke


binaryType.setMimeType(
  new WDWebResourceType(
    WDWebResourceType.DOC.getFileExtension(),
    WDWebResourceType.DOC.getHtmlMime(),
    flase /* isAttachment == false, i.e. inline */
  )
);

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

sid_sunny
Contributor
0 Kudos

Hi Zita,

I guess you want that user should only be allowed to open the file and not save it. If this is what you want then set the <b>Behaviour</b> property of the File Download UI element to openInplace.

Regards

Sid

Former Member
0 Kudos

Hi Sid,

Yes, this is what I want. But I can not find the the Behaviour property of the File Download UI . Are you referring to 2004s?? My version is 2004 though.

How can I do this in 2004??