Find Jobs
Hire Freelancers

Android HttpClient not sending more than 10 MB outofmemory issue

₹600-1000 INR

Sürüyor
İlan edilme: neredeyse 8 yıl önce

₹600-1000 INR

Teslimde ödenir
We were unable to send more than 10MB file to HttpServer .below is the code for sending the file. we need to send 100MB file to server. public int Sending() throws IOException { String iFileName = "[login to view URL]"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; String Tag = "fSnd"; try { Log.e(Tag, "Starting Http File Sending to URL"); // Open a HTTP connection to the URL conn = (HttpURLConnection) [login to view URL](); // Allow Inputs [login to view URL](true); // Allow Outputs [login to view URL](true); // Don't use a cached copy. [login to view URL](false); //[login to view URL](5120); // Use a post method. [login to view URL]("POST"); [login to view URL]("Connection", "Keep-Alive"); [login to view URL]("Content-Type", "multipart/form-data;boundary=" + boundary); DataOutputStream dos = new DataOutputStream([login to view URL]()); [login to view URL](twoHyphens + boundary + lineEnd); [login to view URL]("Content-Disposition: form-data; name=\"title\"" + lineEnd); [login to view URL](lineEnd); [login to view URL](Title); [login to view URL](lineEnd); [login to view URL](twoHyphens + boundary + lineEnd); [login to view URL]("Content-Disposition: form-data; name=\"description\"" + lineEnd); [login to view URL](lineEnd); [login to view URL](Description); [login to view URL](lineEnd); [login to view URL](twoHyphens + boundary + lineEnd); [login to view URL]("Content-Disposition: form-data; name=\"uploadedfile\";filename=\"" + iFileName + "\"" + lineEnd); [login to view URL](lineEnd); Log.e(Tag, "Headers are written"); // create a buffer of maximum size int bytesAvailable = [login to view URL](); int maxBufferSize = 5120; int bufferSize = [login to view URL](bytesAvailable, maxBufferSize); byte[] buffer = new byte[bufferSize]; // read file and write it into form... int bytesRead = [login to view URL](buffer, 0, bufferSize); // [login to view URL]([login to view URL]().size()); while (bytesRead > 0) { [login to view URL](buffer, 0, bufferSize); bytesAvailable = [login to view URL](); bufferSize = [login to view URL](bytesAvailable, maxBufferSize); bytesRead = [login to view URL](buffer, 0, bufferSize); } // while (bytesRead > 0){ // bufferSize = [login to view URL](bytesAvailable, maxBufferSize); // byte byt[]=new byte[bufferSize]; // [login to view URL](byt); // bytesRead = [login to view URL](buffer, 0, bufferSize); // [login to view URL](buffer, 0, bufferSize); // } [login to view URL](lineEnd); [login to view URL](twoHyphens + boundary + twoHyphens + lineEnd); // close streams [login to view URL](); [login to view URL](); Log.e(Tag, "File Sent, Response: " + [login to view URL]([login to view URL]())); // InputStream is = [login to view URL](); // retrieve the response from server int ch; // StringBuffer b =new StringBuffer(); // while( ( ch = [login to view URL]() ) != -1 ){ [login to view URL]( (char)ch ); } // String s=[login to view URL](); // Log.i("Response",s); [login to view URL](); } catch (MalformedURLException ex) { Log.e(Tag, "URL error: " + [login to view URL](), ex); return 0; } catch (IOException ioe) { Log.e(Tag, "IO error: " + [login to view URL](), ioe); return 0; } return [login to view URL](); }
Proje No: 11266895

Proje hakkında

1 teklif
Uzaktan proje
Son aktiviteden bu yana geçen zaman 8 yıl önce

Biraz para mı kazanmak istiyorsunuz?

Freelancer'da teklif vermenin faydaları

Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir
Seçilen:
Kullanıcı Avatarı
I have been developing android programs for 4 years. I have developed many apks. So I think I can do it so that you satisfy. I am looking forward to being hired by you. I'll do my best to do it. Please award my bid and hire me. I'll make you satisfy. Believe me. And Contact to me. I can start my work at once. I'll wait your visit. Thank you!
₹2.250 INR 3 gün içinde
5,0 (14 değerlendirme)
3,9
3,9

Müşteri hakkında

   INDIA bayrağı
hyderabad, India
4,8
12
Ödeme yöntemi onaylandı
Eki 28, 2011 tarihinden bu yana üye

Müşteri Doğrulaması

Teşekkürler! Ücretsiz kredinizi talep etmeniz için size bir bağlantı gönderdik.
E-postanız gönderilirken bir şeyler yanlış gitti. Lütfen tekrar deneyin.
Kayıtlı Kullanıcı İlan Edlien Toplam İş
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ön izleme yükleniyor
Coğrafik konum için izin verildi.
Giriş oturumunuzun süresi doldu ve çıkış yaptınız. Lütfen tekrar giriş yapın.