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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
arunbiet
Posts: 233
Registered: ‎06-22-2010
My Carrier: blackberry developer

How to save images from server into SDCard

I am trying to extract a zip file from a server location and save in SDCard.The zip file contains some xml and images.I am able to save the xml files properly in the SDCard,but with images,they are saving with the same name,but when i try to open the images,it says "File corrupted or damaged".Which means my writing of images to SDCard is  not proper.FYI i am using zipme as third party lib for zip extraction.Can anybody help me to get the image part done?

Please use plain text.
Developer
simon_hain
Posts: 13,796
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: How to save images from server into SDCard

you could try to display the image before writing it to sd card to check if it is correct there.
also check if the downloaded zip file can be opened on a PC to extract and view the pictures.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 17,695
Registered: ‎07-14-2008

Re: How to save images from server into SDCard

I had problems with ZipMe corrupting large files, in fact anything over about 4K.

 

You might find the code provided here does the job:

http://supportforums.blackberry.com/t5/Java-Development/Unzip-zip-archive-with-sample-resource-insta...

 

Becuase it uses the builtin in decompression rather than Java, it should also be a lot faster. 

Please use plain text.