I'm a newbie on java and I have a project for my class. I need to upload or download ( need both ) a .txt file when a button is pressed. The file should be uploaded and downloaded online. I can do this with anything that help me do this , it just need to work. I don't have any knowledge about ftp's etc. What I'm supposed to study?
Have a look at Java Servlets if no frameworks in use.
Here is a simple example
http://www.codejava.net/java-ee/servlet/multipartconfig-annotation-examples
You need to have a basic Java Servlets understandings for this.
Your question is pretty vague but here some steps/ideas that could help you in your homework :
You wants to download a file you could maybe seek here :
(it's assuming that you were given some GET url by your teacher) Get method.
-After having 'getted' the data you could write them in a file in a specific localisation (hard coded in a final variable or asked or
given in params depending on your level of skill).
-You wants to upload a file, using the same classes as in the link for the GET method you could use a POST method with the data to
upload.
Sorry it's pretty vague but i hope it at least helped you.
Related
I asked lately how i can access the meta data of a odt file and the most recomended way to do this was using the apache tika library.
I tried finding out how i can use this Libraries in Detail.
Reading through all this stuff I find that this tika service is pretty hard (at least for someone that is new to Programming like me)
So my question is if maybe someone has a link to a side where there is like a step by step tutorial on how to use it or maybe as a different method to do this. I realy dont want you to do my work but i am working so long on this now and did not get this far so i think its time to ask for help here. :(
I want to acces and set only one property of my file which is the "DocumentID".
Thank you for helping and sorry for my maybe bad english but it is not my foreign language.
I am having trouble finding out what these .w files are and how to using them with my Java code: see Assignment1.zip at http://see.stanford.edu/see/materials/icspmcs106a/assignments.aspx
I would post a screenshot of my files, but I don't have enough "reputation points" to post an image on this site--I usually just read answers from others b/c I'm just learning. I can't open these .w files or else I would paste some of their contents in here.
For the past year, I've worked a good amount with Python and C++, but I decided to learn some Java from these free Stanford online lectures: http://see.stanford.edu/see/lecturelist.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111.
I've looked all over and simply cannot find out what .w files are, and I haven't been able to open them. I realize they're clearly worlds for the graphical robot to move around in, but I can't get the .java & .class files to function with these .w (or "world") files.
I would be happy to post some of my code in here as well, if you want. And I could post an image of the files & folders once I get a good enough reputation.
Could someone please help me?
You seem to be missing the documentation for karel.jar. There is already code for reading and working with these files, in sandford.karel.KarelWorld there is a load(File) method. But you will need to be working with the rest of the classes in the jar file, too, so you'll need to look for documentation (maybe given in the lecture videos?) or you'll have a very frustrating time.
I have a application which is created on ZK Framework , i want to give user a functionality where user can open a saved file in edit mode and then again saved the changed in database can any one know which API can help me to do this?
You could use Google Apps to do so and set Google Docs to edit your DOC, PDF or even XLS extension files. For more help on setting it up, feel free to ask again. :)
The problem you're posing doesn't have a simple answer, unfortunately.
There are two general approaches you could take..
The low hanging fruit is to provide an interface for the user to download a file and upload it after they make edits using whichever editing software they choose / is appropriate.
The other approach would be to provide a GUI to edit files. Regardless of the web framework you are using, this is a daunting task to say the least. As #userRandom mentioned, this is a large part of what Google Drive (formerly Google Docs) is attempting to solve.. but even Google's solution is not perfect and very much a work in progress.
I would strongly suggest evaluating the scope of your project before proceeding.
If you choose to move forward, consider a simple solution that works for .txt files. Then, consider how you might handle .doc files. Then, PDF files, XLS files, etc.
Folks here will be able to answer specific questions.
I just started learning Java, and I have no idea how it works. The programming language I learned before this was PHP.
My question is, how do I use Java on my website? I created a .java file and it showed up like this (it showed the script): http://cpcheats.co/java/learning/index.java
I'm guessing I need to upload java onto my web server. If I do, can you please tell me where to download it, and where to upload it? If I don't need to download Java, can you please tell me how to use it on my website? Thanks.
I'm guessing I need to upload java onto my web server.
Ok....
Go to a bookstore/library and buy/borrow a book on Java. Spend a weekend on it and when you have a programming question, please post it here and many of us here will try to help you.
Well, what you need first is to understand the basic concept of java, and of a java web application (java on the server). You need to follow a course and this is not the place to write a java getting started, because this already exist.
I suggest that you read this:
http://docs.oracle.com/javase/tutorial/getStarted/
http://docs.oracle.com/javaee/1.4/tutorial/doc/WebApp.html
After a couple of hours you should have a better understanding of what java is and what you can do with it.
I would like to be able to retrieve contents of a .txt file from the internet, and load it in an EditText. I tried using the code on this page: Reading Text File From Server on Android
It didn't work, as you might have guessed. I've read on numerous sites about this type of problem, but I can't get anything to work. Someone suggested AndroidHttpClient but I simply can't find any examples with this.
As I'm a newbie in Android programming, I would love if someone could please give me a small example.
This isn't so much of an Android question as it is a Java question. There are a few ways you could go about doing this, but the simplest might be using java.net.HttpURLConnection.