Java Reference
In-Depth Information
This recipe must be provided with a user id, password and the file you want to upload.
The following command is an example of how to launch the recipe.
FormUpload userid password c:\myfile.txt
The above command simply shows the abstract format to call this recipe, with the appro-
priate parameters. For exact information on how to run this recipe refer to Appendix B, C, or
D, depending on the operating system you are using. Once you have uploaded your file, you
should check to see the status of the file upload. You can do this by selecting the “Check the
status of a previous upload” option on the previously mentioned URL. After you enter your
user ID and password you will see a page similar to Figure 7.4.
Figure 7.4: A Successful Upload
We will now examine how to implement this recipe. You can see this recipe in Listing
7.4.
Listing 7.4: Using Multipart Forms to Upload (FormUpload.java)
package com.heatonresearch.httprecipes.ch7.recipe3;
import java.io.*;
import java.net.*;
Search WWH ::




Custom Search