JSPSmartupload

zhaozj2021-02-16  53

/ /========upload.html===========

file upload



/ /=========upload.jsp=======

<% @ page language = "java" import = "com.jspsmart.upload. *"%>

file upload


<%

/ / Define count variables

INT count = 0;

//initialization

MySmartupload.initialize (PageContext);

// Set the maximum upper limit of the file, here is 100KB

MySmartupload.SettotAlMaxFileSize (1000000);

/ / Call the method of instantiated objects of beans to perform upload operation / R

mysmartupload.upload ();

Try {

/ / In the UPLOAD directory store file in the virtual directory

// There is no virtual path to use physical paths, very familiar "/ upload"

Count = mysmartupload.save ("/ upload");

/ / By default, the upload file homologous file name is the same

//count=mysmartupload.save ("/upload" ,mysmartupload.save_virtual);

/ / Display the number of files that have been uploaded

Out.println (count "file (s) Uploaded.");

} catch (exception e) {

Out.println (E.TOString ());

}

%>

转载请注明原文地址:https://www.9cbs.com/read-21226.html

New Post(0)