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
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

How to send bulk amount of data using post method.

[ Edited ]

hi friends,

i have a small problem here i am sending all user contacts to server using post method.

here i am sending all contact details. the data was not sent.i am sending just few contacts(nearly 60 to100).

then it was successfully sent to server. i am sending more than 300 contacts it was not sending the contacts.

please help. requsting is going but in that server they were not getting any contact details.

please help me friends

Please use plain text.
Developer
YamilBracho
Posts: 514
Registered: ‎05-31-2010
My Carrier: Movistar

Re: How to send bulk amount of data using post method.

You can zip the data and send it. Check the GZIPOutputStream  class

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

Re: How to send bulk amount of data using post method.

please post some sample code to send the zip data

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

Re: How to send bulk amount of data using post method.

hi friends,

i am tried but failed. while sending bulk amount of data.

that data was not posted into the server. it was not shown any exceptions and errors here how can we do this in this situation please replay me

 

Thanks in advance.

 

 

Please use plain text.
Developer
YamilBracho
Posts: 514
Registered: ‎05-31-2010
My Carrier: Movistar

Re: How to send bulk amount of data using post method.

compress the data using this code 

public static byte[] compress( byte[] data )
{   
    try
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        GZIPOutputStream gzipStream = new GZIPOutputStream( baos, 6, GZIPOutputStream.MAX_LOG2_WINDOW_LENGTH );
        gzipStream.write( data );
        gzipStream.close();
    }
    catch(IOException ioe)
    {
        return null;
    }

    return baos.toByteArray();
}

 And then sent the byte array returned by this method...

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

Re: How to send bulk amount of data using post method.

Thank you

Please use plain text.