Wednesday, July 23, 2008
Skins.be Forum Brazil
Friday, June 27, 2008
Play-mate Of The Apes Online Streaming
Here is an updated version of the java servlet code for "file upload".
will place the exact steps I followed for the example to work.
In principle, using Netbeans 6 and tomcat 6 for this example.
1. Obterner the library "Commons IO" (see 1.4) From
http://commons.apache.org/io/
2. Get the library "commons file upload" (in this case got the see 1.2.1 January 2008).
http://commons.apache.org/fileupload/ 3
. Both decompress in a folder "c: / libraries"
4. Create a new project called "FileUpload"
Note that I select "Tomcat 6" as the application server.
5. Create a new html called "UploadFile"
the new html Place the following code:
| \u0026lt;HTML> |
6. Add the libraries to be decompressed in the file "c: / libraries "
all libraries will be added commons file upload "
and all libraries will be added commons IO"
All libraries should be so in the environment:
7. It creates a new package, called org.txos
8. It creates a new servlet called "UploadFichero"
9. Place the following code in the servlet:
| / * * UploadFichero.java * * Created on 27/6/2008, 11:22:00 AM * * To change this template, choose Tools */ package org.txos; import java.io.*; import java.net.*; * * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. @ Override protected void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { * Handles the HTTP POST method. |
11. Run it ....
12. Jsp.index initially be displayed, change the path in the browser to:
13. You should see a page like this: 14. Find any file, preferably . Txt and upload ... will see the following page:
15. Find the file "upload" in c: / nuevo.txt. 16. End
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx