Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 116
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

INVOKE_BAD_REQUEST_ERROR while trying to open pptx file in BB10

[ Edited ]

Hi All,


I have to open pptx, pdf, docx files(coming from server) in my BB10 webworks application. Tried with .pptx file but getting error INVOKE_BAD_REQUEST_ERROR.


Below is my code:


blackberry.invoke.invoke( {
				target: "sys.dxtg.stg",
				action: "bb.action.OPEN",
				uri: "http://example.com/files/Test.pptx",
				type: "application/vnd.ms-powerpoint"
				//fileExtensions: ".pptx"
			}, onInvokeSuccess, onInvokeError );
		}, false);

		function onInvokeSuccess(){
			alert("onInvokeSuccess ");

		function onInvokeError(str){
			alert("onInvokeError "+str);


Feature Ids mentioned in Config.xml


<feature id="blackberry.app"/>
	<preference name="WebSecurity" value="disable"/>
	<access uri="http://example.com" subdomains="false" />
	<access uri="https://example1.com" subdomains="false" /> 
	<access uri ="*"/>
	<!-- Cordova API -->
  <feature id="blackberry.system" required="true" version="" />
  <feature id="org.apache.cordova" required="true" version="1.0.0" />
  <feature id="blackberry.find" required="true" version="" />
  <feature id="blackberry.identity" required="true" version="" />
  <feature id="blackberry.identity.phone" required="true" version="" />
  <feature id="blackberry.pim.Address" required="true" version="" />
  <feature id="blackberry.pim.Contact" required="true" version="" />
  <feature id="blackberry.io.file" required="true" version="" />
  <feature id="blackberry.utils" required="true" version="" />
  <feature id="blackberry.io.dir" required="true" version="" />
  <feature id="blackberry.app" required="true" version="" />
  <feature id="blackberry.app.event" required="true" version="" />
  <feature id="blackberry.system.event" required="true" version=""/>
  <feature id="blackberry.widgetcache" required="true" version=""/>
  <feature id="blackberry.media.camera" />
  <feature id="blackberry.ui.dialog" />
  <feature id="blackberry.connection" />
  <feature id="blackberry.bbm.platform" />
  <feature id="blackberry.invoke.card" />
  <feature id="blackberry.pim.contacts" />
  <feature id="blackberry.ui.contextmenu" />
  <feature id="blackberry.io.filetransfer" />
  <feature id="blackberry.io" />
  <feature id="blackberry.invoke" />
  <feature id="blackberry.invoked" />
  <feature id="blackberry.push" />
  <feature id="blackberry.media.microphone" required="true" version=""/>



I tried many combinations in blackberry.invoke.invoke request but still not working. 

Please help. 


Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: INVOKE_BAD_REQUEST_ERROR while trying to open pptx file in BB10

The value of the 'target' and 'action' parameters are incorrect. Is "sys.dxtg.stg" your app?  You want to launch the native apps that support these file formats (e.g. AdobeReader or DocstoGo)



How to invoke a PPT (see link for info about DOCX):



   target: "sys.slideshottogo.previewer",
   action: "bb.action.VIEW",
   type: "application/vnd.ms-powerpoint",
   uri: "http://example.com/files/Test.ppt"
, function() { 
}, function() { 




How to invoke a PDF:



   target: "com.rim.bb.app.adobeReader",
   action: "bb.action.OPEN",
   type: "application/pdf",
   uri: "file:///accounts/1000/shared/documents/Getting Started with Adobe Reader.pdf"
, function() { 
}, function() { 


Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.