wood burning stoves 2.0*
The moose likes Android and the fly likes Transfer File from Android to server via socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Transfer File from Android to server via socket" Watch "Transfer File from Android to server via socket" New topic

Transfer File from Android to server via socket

Tan Kok Lim

Joined: Oct 23, 2012
Posts: 7
Currently, I've created one android apps to enables to send/transfer file from internal storage to remote server via WAN when I stayed in outside.

All files is success transfer but at the end my server is ended up with this message, ( the picture/music files will be success rendered when I quit out this programs )

Exception in thread "main" java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.util.ArrayList.<init>(Unknown Source)
at ServerSocket.com.ServerRun.main(ServerRun.java:60)

Here is my server side code,

Server :

Android Side

My problem is here how can I modify to server side code to avoid this problems on future. Appreciate to any helps and thanks.
Deepak Bala

Joined: Feb 24, 2006
Posts: 6661

The stack trace line number and the one from your code do not match. Line number 60 on ServerRun.java is '{'

Are you sure the information is accurate ?

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
I agree. Here's the link: http://aspose.com/file-tools
subject: Transfer File from Android to server via socket
Similar Threads
Sending a file over socket
Transferring file name then file data over socket
Transfer Multiple File problems via socket
File transfer from Client to Server side
moving files over the network