asked in Softwares+OS+Programming by (48 points) 2 5
replied by LEGEND (7,630 points) 5 15 39

I sure hope that you're a programmer and can write and understand coding. This is what it will take for you to upload a file from your Android device to a server. The coding is extremely long and will take time to write it. However, I did find this code online that you can use. Here is the link to the website and the code so that you can accomplish the task and write the batch file or coding necessary to do what you want to do. Android Upload File

Please log in or register to answer this question.

1 Answer

0 thanks
answered by (319 points) 1 5
The very basic is that Android code is written in Java language. As with any programming language , we can use the File source, fetch the file object which in this case is a .txt file, that needs to be uploaded to the server. Before doing any further processing with the source file, make a check if the source file actually exists in the path, if not please skip and terminate.

If the source file does exist, allocate a new object of FileInputStream with the source file. Open a new network URL connection and set the content type, filename etc in the request parameters of this newly created request. Create the new data output stream and perform a file write, which will upload the file into the destination server.

Related questions

3,050 questions

9,519 answers

4,571 replies

2,199 users

Most active Members
July 2019:
  1. Poehere - 14 activities
  2. paulinavacas - 13 activities
  3. Sai Vineeth - 6 activities
  4. Rasul Raza - 5 activities
  5. SmartAZ - 5 activities
  6. Ayriel Balsor - 3 activities
  7. Rachellatte - 3 activities
  8. Karen G. - 3 activities
  9. lincy - 3 activities
  10. Cgolder - 2 activities
Most answered Members
June 2019:
  1. Option 1 - 30 answers
  2. Leyley - 16 answers
  3. pinakigoswami - 7 answers
  4. DawnG17 - 5 answers
  5. SmartAZ - 5 answers
  6. lincy - 4 answers
  7. Melissa_MK - 4 answers
  8. Liz Malone - 3 answers
  9. GodisLove - 3 answers
  10. Lhisa - 3 answers