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
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Save form to server

[ Edited ]

You see, its really difficult to try to help when people don't explain things properly.

Having an empy alert box and having no alertbox at all are totally different things. If you have no alert box it means your code is not reaching that point at all.

Suggestions (by no specific order)

  • debug it with the inspector
  • put everything in a try..catch block and see if there are any exceptions being thrown
  • place some alerts(or other signs you can see) elsewhere just to find out what pieces of code are actually being ran (note that some people say that babies cry when you use alerts Smiley Wink )
Nuno
Developer
Posts: 30
Registered: ‎06-14-2012
My Device: 9810
My Carrier: Telkomsel

Re: Save form to server


nunodonato wrote:

You see, its really difficult to try to help when people don't explain things properly.

Having an empy alert box and having no alertbox at all are totally different things. If you have no alert box it means your code is not reaching that point at all.

Suggestions (by no specific order)

  • debug it with the inspector
  • put everything in a try..catch block and see if there are any exceptions being thrown
  • place some alerts(or other signs you can see) elsewhere just to find out what pieces of code are actually being ran (note that some people say that babies cry when you use alerts Smiley Wink )

Hi Nuno, you are right, I put alert and I think I know the problem for now, this is my code :

var fileData = "file:///store/home/user/pictures"+filename;
if (blackberry.io.file.exists(fileData))
{
alert('exist');
blackberry.io.file.readFile(fileData, handleOpenedFile);
}else
{
alert('empty'); //empty appear, I guess the file path is wrong, do you know the correct path for pictures in memory card Nuno ??? 
}

 

Developer
Posts: 30
Registered: ‎06-14-2012
My Device: 9810
My Carrier: Telkomsel

Re: Save form to server

Hi Nuno, Thank you man, you save me...
I finally can encode image to base64. 

Highlighted
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Save form to server

No problem!
Don't be lazy, read the API docs. People spend time writing them for a reason Smiley Wink
Nuno