Let's take a look at the implementation of these two different controls:
Smartupload:
<% @ page contenttype = "text / html; charset = GB2312"%> <% @ page import = "java.sql. *"%> <% @ Page Import = "com.jspsmart.upload. *"%>
<% // Installing Bean Smartupload Mysmartupload = New SmartUPload (); // Initialization MySmartupload.initialize (PageContext); // Set the maximum value upload, pay attention: If you set up a meeting here! MySmartupload.setMaxFileSize (500 * 1024 * 1024); // Upload file mysmartupload.upload (); // loop acquire all uploaded file for (int i = 0; i
Commons-fileupload:
<% @ page language = "java" contenttype = "text / html; charSet = GBK"%> <% @ page import = "java.util. *"%> <% @ page import = "org.apache.commons. FileUpload. * "%>
Behind a lot, he first puts the file cache, waiting until the entire file is over, after a disposable copy file.
But both of the above two methods are HTTP file transfer, and the efficiency is not high! It is recommended to use FTP directly.