09-14-2011 02:27 PM - edited 09-14-2011 02:28 PM
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
09-14-2011 03:04 PM
You can zip the data and send it. Check the GZIPOutputStream class
09-15-2011 01:48 AM
please post some sample code to send the zip data
09-15-2011 02:11 AM
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.
09-15-2011 09:56 AM
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...
09-16-2011 12:18 AM
Thank you