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
New Contributor
gcsantiago
Posts: 4
Registered: ‎10-12-2012
My Device: BB10 Dev Alpha

Send files to remote server

I am still need help on this...

 

Image files in an array

["file:///accounts/1000/shared/photos/Simple1.jpg ",

"file:///accounts/1000/shared/photos/Simple2.jpg ",

"file:///accounts/1000/shared/photos/Simple3.jpg ",

"file:///accounts/1000/shared/photos/Simple4.jpg "]

 

for (var i=0;i < array.length; i++) { 

name = array[i];

...

 

I try to use blackberry.io.filetransfer.upload on bb10 alpha but dont work for me... always fire uploadError callback with number 1. i tryed a lot of differents paths. 

 

var options = {
fileKey : "userfile",
fileName : name, //only the name of img
mimeType : "image/jpg",
chunkedMode : true,
chunkSize : 1024
};

 

blackberry.io.sandbox = false;
blackberry.io.filetransfer.upload(img, "http://www.gipegasus.com.ar/simple/uploadimg.php", uploadSuccess, uploadError, options);

 

Error code: 1 
Source: file:///accounts/1000/shared/photos/Simple.jpg 
Target: http://www.gipegasus.com.ar/simple/uploadimg.php
HTTP Status: undefined

 

What is wrong?

Any hint?, thanks

Please use plain text.
Developer
TheFlowFX
Posts: 166
Registered: ‎02-15-2012
My Device: Playbook 16GB

Re: Send files to remote server

Have you declared a new feature in your config.xml file?

 

<feature id="blackberry.io.filetransfer" />

 Have a look at his page and see if it helps you further:

File Transfer

If any post helps you please click the Like Button below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!

Please use plain text.
New Contributor
gcsantiago
Posts: 4
Registered: ‎10-12-2012
My Device: BB10 Dev Alpha

Re: Send files to remote server

[ Edited ]

TheFlowFX, thanks for reply, but will not that easy answer... I already learn the API and copy the example exactly from there but fail...

Yes I already declare 

<feature id="blackberry.io.filetransfer" />

 

¿Do You have a bb10 Alpha Device?

¿Do You test the example?

¿Do You already use the API in a succesful way?

 

Please, try it yourself and help me to figure out why are failing! Thanks in advance

 

PS: remember that need to take files names from an array, not to write a fixed path or take it from an input form.

Please use plain text.