If you used
VB
Write the file to the file uploaded, then
Java
Write file upload
Javabean
It is easy.
The following example is just a short version.
package yuanyifileup; import java.io *;. import java.util *;. import javax.servlet *;. import javax.servlet.http *;. import javax.servlet.jsp.PageContext; public class yuanyifileup {private ServletRequest request; private ServletResponse response; private ServletConfig config; ServletInputStream DATA; int FormSize; File f1; FileOutputStream os; DataInputStream is; String filename; byte [] b; byte t; boolean flag = false; public yuanyifileup () {} public void initialize (ServletConfig config, HttpServletRequest request, HttpServletResponse response) throws IOException {this.request = request; this.response = response; this.config = config; DATA = request.getInputStream (); FormSize = request.getContentLength ();} public void initialize ( PageContext pageContext) throws IOException {request = pageContext.getRequest (); response = pageContext.getResponse (); config = pageContext.getServletConfig (); DATA = request.getInputStream (); FormSize = request.getContentLength ();} public boolean setFilename (String s) {Try {file f1 = new file (s); OS = New FileOutputstrea M (f1);} caturn (false);} return (true);} public void getByte () {INT i = 0; try {is = new datainputstream (data); b = new byte [ Formsize]; while (true) {TRY {T = is.readbyte (); b [i] = t; i ;} catch (eofexception e) {Break;}} is.close ();} catch (ooException e) {}} public boolean save () {INT i = 0, start1 = 0, start2 = 0; string temp = ""; if (! flag) {GetByte (); flag = true;} try {temp = new string B, "ISO8859_1");} Catch (unsupporteencodingExcection e) {return (false);} start1 = temp.indexof ("image /"); temp = temp.substring (start1); start1 = Temp.indexof ("/ r /N/r/n" ";TEMP=TEMP.SUBSTRING (START1 4 );start2=temp.indexof(";/R/N "