Hi! is possible to upload a file on apache server using commons-fileuploader jar file in android .. if yes then please give any reference site if no then please guide me.
+1
A:
It is possible, yes.
If you're using Eclipse and the ADT plugin, you just have to do the following things:
- copy the commons-fileupload-1.2.1.jar file to the root of your project.
- Right click on your project icon to access its properties.
- go to "Java Build Path"
- click on the "Libraries" and then on "Add JARs"
- choose the commons-fileupload file, and click OK.
You're then ready to go. ADT will automatically convert the classes in the jar file into the dex file format for use in dalvik, and embed them into your APK file.
If you need documentation on how to use the library just follow the user manual: http://commons.apache.org/fileupload/using.html
SirDarius
2010-07-20 09:27:43
Thanks SirDarius.... but i have also pass some variable values (like String filename="MyFile", int id=10) with this file so what is the way.... it will be compatible with Commons-fileupload-1.2.1.jar?
Shalini Singh
2010-07-20 09:43:04
even though my answer is a good starting point to learn how to use external jars in android projects, I completely forgot that commons-fileuploads is strictly a server-side component.I'll point you to http://www.theserverside.com/news/1365153/HttpClient-and-FileUpload that suggests a method to use apache HttpClient to upload files.
SirDarius
2010-07-20 09:58:33