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
Contributor
Posts: 20
Registered: ‎04-30-2012
My Device: Playbook
My Carrier: Potato
Accepted Solution

Javascript copy files in Playbook directory

[ Edited ]

I'm trying to copy images from my application directory to the playbook picture folder.

I haven't been doing javascript in a long time, and unsure what I'm doing wrong. Can someone please point me to the right direction? Thanks

 

<script language="javascript">
function downloadImage() {
var picturePath = "accounts/1000/shared/photos";
var imagePath= "../images/";

copy(imagePath+ "picture.jpg", picturePath);
}
</script>

I can't wait for dinner! Smiley Tongue
Contributor
Posts: 20
Registered: ‎04-30-2012
My Device: Playbook
My Carrier: Potato

Re: Javascript copy files in Playbook directory

[ Edited ]

okay... ignore my last post I was being stupid Smiley Tongue
ReRead the API Reference:
Shouldve wrote
blackberry.io.file.copy(filePath, "file:///SDCard/myxmlfile2.xml");
Instead of
copy(filePath, "file:///SDCard/myxmlfile2.xml");

I can't wait for dinner! Smiley Tongue