Welcome!

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

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

fileTransfer API and Twitter / Facebook

[ Edited ]

Has anyone started using the blackberry.io.fileTransfer API for BB10 to upload / download resources from external sites like Twitter or Facebook (e.g. posting images).

 

https://developer.blackberry.com/html5/apis/blackberry.io.filetransfer.html

 

I'm looking to measure how successful people have been so far.  

 

Any unusual connection issues, or response codes that prevent you from interacting with these services?

 

Edit (08/01/12): Adding link to fileTransfer sample application https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/fileTransfer

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: fileTransfer API and Twitter / Facebook

Hi Adam.

 

I'm on the way to the fileTransfer API. Next days will give it a try. You want to give it a test in using Twitter/FB or all sources available?

 

BTW: While reading the API again right now, what about authentification? Thought it is part in other Frameworks on other Platforms as well?!

 

Regards.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: fileTransfer API and Twitter / Facebook

[ Edited ]

Working with the fileTransfer Download API brings me to the following requests and issues:

 

Requests:

  • adding the <feature id="blackberry.io.filetransfer" required="true" /> should implement something like a FileTransferError object comparable to the FileError object of file interactions
  • if download succeeded there should be more informations about the fileTransfer to handle things like HTTP reponse header information, ...:
    • Content-Disposition: to get the "filename" if added, so user could download a file by URL and perhaps selected local folder and do not need to worry about filenames if fileTransfer API use this one, on the other hand the developer could be able to rename the file to the same "filename" if not possible directly by fileTransfer API; one could argument you have the "filename" in the URL calling, but you may not like this example shows "http://c0014409.r32.cf1.somecdn.com/file102abc"
    • Last-Modified: using this one, if present, for the files date+time would be good
  • response if a download succeeded could contain a fileEntry reference to the downloaded file
  • edit1: if file already exists, there should be the ask dialog (like when accessing https:// URLs I tested to allow the access) to overwrite or maybe something to provide another filename for it or store as "filename(1).ext"?!
  • edit2: a nice to have for upload as well as for download would be a progress handler

 

Issue:

  • got/produced an error with a HTTP status 403 but the error code is INVALID_URL_ERR = 2; I think there should be another error code for 403 forbidden like the comparable FileError.SECURITY_ERR since the URL I used here isn't invalid, isn't it?

 

 

That's for now.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: fileTransfer API and Twitter / Facebook

[ Edited ]

Great feedback, thank you for posting.

 

The question about a progress event has come up before. I will be submitting a feature request to the BB10-WebWorks-Framework project in Github for that.  As well, I like your suggestion about improvements to the info object parameter for the success/error callbacks.  Added that here:

 

 

https://github.com/blackberry/BB10-WebWorks-Framework/issues/169

 

Edit: Progress feature request submitted https://github.com/blackberry/BB10-WebWorks-Framework/issues/170

 

Note: You are welcome to do the same your own feature requests.

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Developer
nunodonato
Posts: 313
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha

Re: fileTransfer API and Twitter / Facebook

Hi Adam,

 

I'm implementing this in my App now, but after the download starts, the app just crashesh back to the main OS screen.. about 2seconds after.

Any clue what this might be? Running in the latest Dev Alpha.

 

thanks

Nuno
theBBthing.wordpress.com - my BlackBerry development blog: news, tips and tutorials
bitoutsidethebox.com - re-imagining digital solutions


Please use plain text.