0

Help me please I have searched and searched but I have not found an operational code, a code that allows to upload a file from my android application to my Tomcat server 6,

I need the code on the client side and server side. thank you very much

Zombie_Colonel
  • 227
  • 1
  • 7
  • 17

2 Answers2

2

For the Server check out:

file upload "multipart/form" Exception org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException

And the client:

Android file uploader with server-side php

You should be able to adapt the code from these posts.

Good luck.

Community
  • 1
  • 1
John N
  • 51
  • 5
  • here I have tested the upload with a JSP page in the server but it appears to me the following error: java.io.FileNotFoundException: \data\data\com.main\files\images.jpg (Le chemin d'accès spécifié est introuvable) I wonder how he will access the phone to retrieve the photo? – Zombie_Colonel Apr 11 '12 at 02:40
  • @Zombie_Colonel would you be more specific, are you saying the jsp code thew an exception? Please provide a stack trace along with your code. – John N Apr 11 '12 at 05:14
0

You need to create a web service on your Tomcat server. You can do this using java servlets, php, or a WCF service in. NET. Then access your web service using a RESTful client

  • Yes i know and i want to use java servlets, in fact i posted this topic for having the code directly if somebody already made why the remake ? – Zombie_Colonel Apr 11 '12 at 01:02