js| Introduction | Upload A, first download jspsmartupload components
HTTP://DBOY520.51.NET/CGI-BIN/NEWJAVAJIA/DOWNCOUNT.PHP?ID=22 (Site address)
Http://www.jspsmart.com
Second, the contents of the directory jspsmartupload/wib_inf/classes copy to the site in the actual directory in the Web-inf (resin is this directory, the other may be classes, please refer to the jspsmartupload/ help/setup.htm)
Third, if it is resin run JSP, please resin in the conf/resin.conf of the
<web-app> and </web-app> add:
<path-mapping url-pattern= '/upload/* ' real-path= ' f:\jsp\jspsmartupload\upload '/>
File Upload
Mysmartupload.upload ();
Get the contents of the text
String content = Mysmartupload.getrequest (). GetParameter ("Text1");
Display the contents of a text
OUT.PRINTLN (content);
Upload Stats
for (int i=0;i<mysmartupload.getfiles (). GetCount (); i++) {
Com.jspsmart.upload.File myFile = Mysmartupload.getfiles (). GetFile (i);
if (!myfile.ismissing ()) {
Myfile.saveas (destination+ myfile.getfilename ());
Out.println ("File name =" + myfile.getfieldname () + "<BR>");
OUT.PRINTLN ("File size =" + myfile.getsize () + "<BR>");
Out.println ("File name =" + myfile.getfilename () + "<BR>");
OUT.PRINTLN ("File size =" + myfile.getfileext () + "<BR>");
Out.println ("File path name =" + myfile.getfilepathname () + "<BR>");
Out.println ("File type =" + myfile.getcontenttype () + "<BR>");
Out.println ("Contentdisp =" + myfile.getcontentdisp () + "<BR>");
Out.println ("MIME type =" + myfile.gettypemime () + "<BR>");
Out.println ("subtypemime =" + myfile.getsubtypemime () + "<BR>");
Count + +;
}
}
Out.println ("<BR> can upload" + mysmartupload.getfiles (). GetCount () + "file <BR>");
OUT.PRINTLN (count + "files have been uploaded");
%>
</BODY>
</HTML>
The above is the whole process of JSP file upload, good luck!
In the case of retaining http://www.javajia.com original source, welcome reprint!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.