flex多文件上传工具
flex多文件上传工具(自用)
JAVA类
package com.shine.framework.flexUpload;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import com.shine.framework.config.FrameworkConfigFactory;
public class FileUploaded extends HttpServlet {
// 定义文件的上传路径
private String uploadPath = FrameworkConfigFactory.getConfig().getSysPath()
+ "\\upload\\";
// 限制文件的上传大小
private int maxPostSize = 100 * 1024 * 1024;
public FileUploaded() {
super();
}
public void destroy() {
super.destroy();
}
public void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.out.println("Access !");
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
// 保存文件到服务器中
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setSizeThreshold(4096);
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setSizeMax(maxPostSize);
try {
List fileItems = upload.parseRequest(request);
Iterator iter = fileItems.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
if (!item.isFormField()) {
String name = new String(item.getName().getBytes("gbk"),"utf-8");
System.out.println(name);
try {
item.write(new File(uploadPath + name));
// SaveFile s = new SaveFile();
// s.saveFile(name);
} catch (Exception e) {
e.printStackTrace()
相关文档:
有好用的东西一定要共享。
PaginationDataGrid.mxml文件分页组件
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
<mx:Script source="../../../common/utils/Commo ......
A client asked me to do something seemingly simple.
"I want the Alert to have just this one sentence bolded."
Well, it's not exactly simple, so here's how you do it:
there are two solutions as below :
import mx.core.IUITextField;
use namespace mx.core.mx_internal;
message +="Press ......
转载自http://blog.csdn.net/friendyi/archive/2008/07/07/2621034.aspx
Application组件样式属性
backgroundImage 背景图 &nb ......
Flex 4带给我们的,是全新的命名空间。了解这些命名空间必定是一件好事情。Flex 4有三个非常重要的命名空间,分别是:
xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:mx=”library://ns.adobe.com/flex/halo”
xmlns:s=”library://ns.adobe.com/flex/spark&rdq ......