锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲色婷婷久久99精品,亚洲成a人片在线不卡一二三区,久久久亚洲精品无码http://www.tkk7.com/leekiang/category/25298.htmlMDA/MDD/TDD/DDD/DDDDDDDzh-cnThu, 04 Feb 2010 14:54:54 GMTThu, 04 Feb 2010 14:54:54 GMT60澶氭枃浠朵笂浼?/title><link>http://www.tkk7.com/leekiang/archive/2010/02/02/311732.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Tue, 02 Feb 2010 14:57:00 GMT</pubDate><guid>http://www.tkk7.com/leekiang/archive/2010/02/02/311732.html</guid><wfw:comment>http://www.tkk7.com/leekiang/comments/311732.html</wfw:comment><comments>http://www.tkk7.com/leekiang/archive/2010/02/02/311732.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/leekiang/comments/commentRss/311732.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/leekiang/services/trackbacks/311732.html</trackback:ping><description><![CDATA[ <a target="_blank" >jquery-transmit</a>:<br />jQuery Multi-file Uploader with Flash<img src ="http://www.tkk7.com/leekiang/aggbug/311732.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/leekiang/" target="_blank">leekiang</a> 2010-02-02 22:57 <a href="http://www.tkk7.com/leekiang/archive/2010/02/02/311732.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>commons-fileupload 1.2鍙戝竷鏃剁殑瀹樻柟澹版槑http://www.tkk7.com/leekiang/archive/2008/09/27/231469.htmlleekiangleekiangSat, 27 Sep 2008 04:34:00 GMThttp://www.tkk7.com/leekiang/archive/2008/09/27/231469.htmlhttp://www.tkk7.com/leekiang/comments/231469.htmlhttp://www.tkk7.com/leekiang/archive/2008/09/27/231469.html#Feedback0http://www.tkk7.com/leekiang/comments/commentRss/231469.htmlhttp://www.tkk7.com/leekiang/services/trackbacks/231469.htmlCompared to the previous version 1.1.1, the following notable changes have been made:
聽聽聽 * A streaming API has been added. The streaming API allows to handle arbitrarily large files without intermediary files while still keeping an extremely low memory profile.
聽聽聽 * The presence of a content-length header is no longer required.
聽聽聽 * Added support for progress listeners.
聽聽聽 * Added support for header continuation lines.
聽聽聽 * Added support for limiting the actual file size, as opposed to the request size.



leekiang 2008-09-27 12:34 鍙戣〃璇勮
]]>
hibernate澶勭悊oracle澶у瓧孌?/title><link>http://www.tkk7.com/leekiang/archive/2008/09/24/230867.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Wed, 24 Sep 2008 06:01:00 GMT</pubDate><guid>http://www.tkk7.com/leekiang/archive/2008/09/24/230867.html</guid><wfw:comment>http://www.tkk7.com/leekiang/comments/230867.html</wfw:comment><comments>http://www.tkk7.com/leekiang/archive/2008/09/24/230867.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/leekiang/comments/commentRss/230867.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/leekiang/services/trackbacks/230867.html</trackback:ping><description><![CDATA[1,浠ヤ笅鏄竴浜涢浂紕庣殑璁板綍錛屼笉鍏ㄣ?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">瀛楁涓簀ava.sql.Blob綾誨瀷</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">Fj聽fj聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽Fj();<br />fj.setAttblob(Hibernate.createBlob(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]));</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">鐢╡mpty_blob()鏇挎崲?</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">session.save(fj);<br />session.flush();<br />session.refresh(fj,聽LockMode.UPGRADE);<br />org.hibernate.blob.SerializableBlob聽sb聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"><br />(org.hibernate.blob.SerializableBlob)聽fj.getAttblob();<br />oracle.sql.BLOB聽blob聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(oracle.sql.BLOB)聽sb.getWrappedBlob();<br />OutputStream聽os聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽blob.getBinaryOutputStream();<br /></span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">------</span></div><br />2,鐢╦dbc璇誨彇CLOB<br />http://hi.baidu.com/xh28025/blog/item/f61c2df1ef8130c47831aa70.html<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">String聽description聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽query聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">select聽picstr聽from聽clobtest_table聽where聽id聽=聽'001'</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />pstmt聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽con.prepareStatement(query);<br />ResultSet聽result聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽pstmt.executeQuery();<br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(result.next()){<br />聽聽聽oracle.jdbc.driver.OracleResultSet聽ors聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽(oracle.jdbc.driver.OracleResultSet)result;<br />聽聽聽oracle.sql.CLOB聽clobtmp聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(oracle.sql.CLOB)聽ors.getClob(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">);<br /><br />聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(clobtmp</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">聽clobtmp.length()</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">){<br />聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">======CLOB瀵硅薄涓虹┖聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽description聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">;<br />聽聽聽}</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">{<br />聽聽聽description</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">clobtmp.getSubString((</span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">)clobtmp.length());//浠?寮濮?<br />聽聽聽System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">======瀛楃涓插艦寮徛?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">description);<br />聽聽聽}<br />}</span></div><br /><br /><img src ="http://www.tkk7.com/leekiang/aggbug/230867.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/leekiang/" target="_blank">leekiang</a> 2008-09-24 14:01 <a href="http://www.tkk7.com/leekiang/archive/2008/09/24/230867.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤commons fileupload鐨勯浂紕庣瑪璁?/title><link>http://www.tkk7.com/leekiang/archive/2007/08/27/139844.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Mon, 27 Aug 2007 03:58:00 GMT</pubDate><guid>http://www.tkk7.com/leekiang/archive/2007/08/27/139844.html</guid><wfw:comment>http://www.tkk7.com/leekiang/comments/139844.html</wfw:comment><comments>http://www.tkk7.com/leekiang/archive/2007/08/27/139844.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.tkk7.com/leekiang/comments/commentRss/139844.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/leekiang/services/trackbacks/139844.html</trackback:ping><description><![CDATA[鎴戝琛ㄥ崟涓婁紶鐨勭悊瑙?鍙兘鏈夎):<br />聽<form action="" method="post" enctype="multipart/form-data"><br />聽鏈澶т笂浼?G.<br /><a target="_blank" >閫氳繃 http 鍗忚涓婁紶鏂囦歡(rfc1867鍗忚姒傝堪錛宩sp 搴旂敤涓句緥錛屽鎴風(fēng)鍙戦佸唴瀹規(guī)瀯閫?</a><br />聽鏈嶅姟鍣ㄦ帴鏀跺埌涓婁紶鐨勬祦錛岃嚜宸卞叾瀹炴槸涓嶄綔浠諱綍澶勭悊鐨勶紝閭d釜request榪樻槸鍘熻鐨?璋佹潵澶勭悊榪欎釜request鍛?涓鑸噰鐢ㄧ涓夋柟鐨勫伐鍏鳳紝榪欓噷浠ommons fileupload涓轟緥.<br />聽<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">DiskFileItemFactory聽factory聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽DiskFileItemFactory();<br />factory.setSizeThreshold(</span><span style="color: rgb(0, 0, 0);">4096</span><span style="color: rgb(0, 0, 0);">);</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽璁劇疆緙撳啿,榪欎釜鍊煎喅瀹氫簡(jiǎn)鏄痜ileinputstream榪樻槸bytearrayinputstream</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">factory.setRepository(new File(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">d:\\temp</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">璁劇疆涓存椂瀛樻斁鐩綍,榛樿鏄痭ew File(System.getProperty("java.io.tmpdir"))</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">ServletFileUpload聽sfu聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽ServletFileUpload(factory);<br />sfu.setSizeMax(</span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">1024</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">1024</span><span style="color: rgb(0, 0, 0);">);</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">100M</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">List items聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽sfu.parseRequest(request);</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">浼犲叆鐨勮繖涓猺equest榪樻槸鍘熻鐨?/span></div>聽瑙佷笂闈㈢殑浠g爜錛宑ommons fielupload閫氳繃ServletFileUpload綾葷殑<span style="color: rgb(0, 0, 0);"><font color="#0000ff">parseRequest(request)<font color="#000000">鏂規(guī)硶澶勭悊榪欎釜鍘熷嫻併傝?/font></font></span>ServletFileUpload<span style="color: rgb(0, 0, 0);"><font color="#0000ff"><font color="#000000">鍙堜細(xì)璋冪敤鍏剁埛鐖風(fēng)被FileUploadBase鐨刾arseRequest(request)鏂規(guī)硶錛岀劧鍚庡張浼?xì)璋價(jià)eturn parseRequest(new ServletRequestContext(request)),浠g爜濡備笅<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);">聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽FileItemIterator聽iter聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽getItemIterator(ctx);<br />聽聽聽聽聽聽聽聽聽聽聽聽List聽items聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽ArrayList();<br />聽聽聽聽聽聽聽聽聽聽聽聽FileItemFactory聽fac聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽getFileItemFactory();<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(fac聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽NullPointerException(<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">No聽FileItemFactory聽has聽been聽set.</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">聽(iter.hasNext())聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽FileItemStream聽item聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽iter.next();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽FileItem聽fileItem聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽fac.createItem(item.getFieldName(),<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽item.getContentType(),聽item.isFormField(),<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽item.getName());<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);">聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Streams.copy(item.openStream(),聽fileItem.getOutputStream(),<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}聽</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">聽(FileUploadIOException聽e)聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽(FileUploadException)聽e.getCause();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}聽</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">聽(IOException聽e)聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽I(yíng)OFileUploadException(//鎶ラ敊緇忓父鍦ㄨ繖閲?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Processing聽of聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽MULTIPART_FORM_DATA<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽request聽failed.聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽e.getMessage(),聽e);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(fileItem聽</span><span style="color: rgb(0, 0, 255);">instanceof</span><span style="color: rgb(0, 0, 0);">聽FileItemHeadersSupport)聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">final</span><span style="color: rgb(0, 0, 0);">聽FileItemHeaders聽fih聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽item.getHeaders();<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽((FileItemHeadersSupport)聽fileItem).setHeaders(fih);<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽items.add(fileItem);<br />聽聽聽聽聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽items;<br />聽聽聽聽聽聽聽聽}聽</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">聽(FileUploadIOException聽e)聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽(FileUploadException)聽e.getCause();<br />聽聽聽聽聽聽聽聽}聽</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">聽(IOException聽e)聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileUploadException(e.getMessage(),聽e);<br />聽聽聽聽聽聽聽聽}<br />聽聽聽聽</span></div><br />聽榪欓噷娉ㄦ剰,<font color="#0000ff">涓婁紶鐨?lt;input type=file</font></font></font></span><font color="#0000ff">>鏍囪涓瀹氳鏈塶ame,濡傛灉娌℃湁錛宑ommons fielupload涓嶄綔澶勭悊</font>銆?br />聽commons fielupload浼?xì)鎶婁笂浼犵殑鏂囦欢浠箒鐨勬柟寮忓啓鍏ュ埌temp鏂囦歡澶?涓存椂鏂囦歡澶瑰彲浠ヨ嚜宸辮瀹氾紝濡傛灉涓嶆墜鍔ㄨ緗紝鍒欐槸Servlet瀹瑰櫒涓簑eb搴旂敤鍒嗛厤鐨勪復(fù)鏃剁洰褰?tomcat鍙兘灝辨槸<font color="#ff0000">%TOMCAT_HOME%\temp</font>錛屾垜鐢╳eblogic鏃訛紝鏄?font color="#ff0000">C:\DOCUME~1\yourname\LOCALS~1\Temp\</font>銆傝繖浜涗復(fù)鏃舵枃浠朵互"upload"寮澶達(dá)紝鏍煎紡鏄?tmp,渚嬪<font color="#ff0000">"upload_47fdc3_11c9eb678b0__8000_00000043.tmp"</font><br />聽鍦ㄤ笂浼犺繃紼嬩腑commons fielupload鎵嶇煡閬撲笂浼犵殑鏂囦歡鐨勫ぇ灝忥紝濡傛灉浣犲畾涔夊厑璁哥殑鏈澶ч檮浠朵負(fù)100M錛岀劧鍚庝綘涓婁紶涓涓?00M鐨勬枃浠?閭d箞鍙湁瀹為檯浼犺緭浜?00M浠ュ悗錛宑ommons fielupload鎵嶇煡閬撹秴榪囦簡(jiǎn)錛岀劧鍚庢姏鍑轟竴涓紓甯?<font color="#ff0000">org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException</font>)銆?br />聽commons fielupload澶勭悊瀹屼簡(jiǎn)浠ュ悗(澶勭悊榪囩▼鍏ㄥ湪<span style="color: rgb(0, 0, 0);"><font color="#0000ff">parseRequest(request)</font>鏂規(guī)硶閲?/span>)錛岃繑鍥炰竴涓狶ist,閲岄潰鐨勬瘡涓欏瑰凡琚皝瑁呬負(fù)FileItem,浣犻氳繃<font color="#0000ff">fileItem.isFormField()</font>鍒ゆ柇鍑烘槸鏅氱殑琛ㄥ崟灞炴у憿錛岃繕鏄竴涓枃浠訛紝濡傛灉鏄枃浠訛紝浣犲彲浠ヤ粠<font color="#0000ff">fileItem.getInputStream()</font>鑾峰緱杈撳叆嫻侊紝榪欎釜杈撳叆嫻佸叾瀹炴槸涓涓狥ileInputStream.褰撶劧錛屽鏋滄枃浠跺緢灝忥紝鍒欐槸ByteArrayInputStream.閭d箞濡備綍鍖哄垎錛熻繖涓よ呯殑鍖哄埆鏄敱<font color="#0000ff">factory.setSizeThreshold(4096)</font>紜畾鐨勩傚ぇ浜?K,涓篎ileInputStream,灝忎簬4K涓築yteArrayInputStream<br /><br />榪欐牱灝卞彲浠ヨВ閲妔truts鐢ˋctionForm鐨勬柟寮忓鐞嗕笂浼犻檮浠剁殑涓浜涢棶棰樹簡(jiǎn)錛宻truts鎺ユ敹鍒癳nctype="multipart/form-data"鐨刾ost璇鋒眰鍚庯紝浼?xì)鐪嬮偅涓搴旂殑action鏈夋病鏈夐厤緗產(chǎn)ctionform錛屽鏋滈厤緗簡(jiǎn)錛屽氨浼?xì)浣滀竴浜涘鐞嗭紝鎵浠ヤ綘鍦╝ction閲屽緱鍒扮殑request宸茬粡涓嶆槸涓涓櫘閫氱殑request浜?jiǎn)锛岃屾槸涓涓灝佽榪囩殑request銆傚鏋滄兂寰楀埌鍘熷鐨剅equest錛屽氨涓嶈struts-config.xml閲岀粰action綾婚厤緗產(chǎn)ctionform<br /><br />tempDir鎸囧畾鐨勭洰褰曚腑鍙兘浼?xì)闅忕潃鏃墮棿鎺ㄧЩ鍑虹幇寰堝鍚庣紑涓?tmp"鐨勫瀮鍦炬枃浠訛紝commons-fileupload1.2鎻愪緵浜?jiǎn)涓涓笉閿欑殑瑙e喅鏂規(guī)硶錛屽氨鏄妸涓嬮潰鐨勪唬鐮佸姞鍏ュ埌web.xml涓嵆鍙?br /><listener><br /><listener-class><br />org.apache.commons.fileupload.servlet.FileCleanerCleanup<br /></listener-class><br /></listener> <br />鏉ユ簮:<a target="_blank" >http://fratemity1314.spaces.live.com/Blog/cns!E3BCC13A1E72BB4F!222.entry</a><br /><br /><span id="a86m0us" class="tpc_content">Q:I'm using FileUpload in an Action, but it's not working. Why? <br /><br />A:Struts recognises multipart requests, and parses them automatically, presenting the request parameters to your code in the same manner as if they were regular request parameters. Since struts has already processed the request, and made it available in your form bean, the input stream is no longer available for parsing, so attempting to do so with FileUpload will fail. <br /><br />Q:But I need to parse the request myself. How can I do that? <br /><br />A:Struts parses multipart a request as a part of the process of populating your form bean from that request. If, for some reason, you need to have full control over the multipart parsing, you can do so by configuring your action mapping without an associated form bean. (A better way of doing this, however, is to replace the default multipart handler with your own. See the struts documentation for details.) </span><br /><br /><br />1錛岀洿鎺ョ敤commons fileupload鑰屼笉鐢╯truts鐨凙ctionForm鏃?琛ㄥ崟閲岀殑灞炴у間笉鑳界敤request.getParameter()鑾峰彇浜?jiǎn)锛岃寀rl閲岀殑queryString鍙互銆?br />2,聽 鑾峰彇form閲岀殑灞炴у肩殑浠g爜<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 0, 0);"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽String聽formname聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽fi.getFieldName();</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽鑾峰彇form涓殑鍚嶅瓧</span><span style="color: rgb(0, 128, 0);"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽String聽formcontent聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽fi.getString();<br /><img id="Codehighlighter1_130_247_Open_Image" onclick="this.style.display='none'; Codehighlighter1_130_247_Open_Text.style.display='none'; Codehighlighter1_130_247_Closed_Image.style.display='inline'; Codehighlighter1_130_247_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_130_247_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_130_247_Closed_Text.style.display='none'; Codehighlighter1_130_247_Open_Image.style.display='inline'; Codehighlighter1_130_247_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(formname.equals(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">))聽</span><span id="Codehighlighter1_130_247_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_130_247_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽id聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽formcontent;</span><span style="color: rgb(0, 0, 0);"><br /><img id="Codehighlighter1_284_349_Open_Image" onclick="this.style.display='none'; Codehighlighter1_284_349_Open_Text.style.display='none'; Codehighlighter1_284_349_Closed_Image.style.display='inline'; Codehighlighter1_284_349_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_284_349_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_284_349_Closed_Text.style.display='none'; Codehighlighter1_284_349_Open_Image.style.display='inline'; Codehighlighter1_284_349_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(formname.equals(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">title</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">))聽</span><span id="Codehighlighter1_284_349_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_284_349_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽title聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽formcontent;<br /><img id="Codehighlighter1_389_463_Open_Image" onclick="this.style.display='none'; Codehighlighter1_389_463_Open_Text.style.display='none'; Codehighlighter1_389_463_Closed_Image.style.display='inline'; Codehighlighter1_389_463_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_389_463_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_389_463_Closed_Text.style.display='none'; Codehighlighter1_389_463_Open_Image.style.display='inline'; Codehighlighter1_389_463_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(formname.equals(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">memo</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">))聽</span><span id="Codehighlighter1_499_561_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_499_561_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽memo聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽formcontent;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}</span></span><span style="color: rgb(0, 0, 0);"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span></div><br />3, 琛ㄥ崟閲岀殑file鎺т歡鐨刵ame涓嶈兘涓虹┖銆?br />4錛屼笂浼犲ぇ鏂囦歡(190澶歁)鏃舵姤寮傚父<br />org.apache.commons.fileupload.FileUploadException: 聽 Processing 聽 of 聽 multipart/form-data 聽 request 聽 failed. 聽 EOF 聽 after 聽 reading 聽 only: 聽 "3567789 " 聽 of: 聽 "203323339 " 聽 promised 聽 bytes, 聽 out聽 of 聽 which 聽 at 聽 least: 聽 "0 " 聽 were 聽 already 聽 buffered<br />http://forums.bea.com/thread.jspa?threadID=200033356<br />http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=121&threadID=20060&start=0&tstart=0<br />http://thisisxy.blogcn.com/diary,204014352.shtml<br />http://www.80diy.com/home/20050527/17/4040711.html<br /><br />5錛?br /><span lang="EN-US"><font face="Times New Roman" size="3">org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out<br /></font></span><font size="3"><span style="font-family: 瀹嬩綋;"></span><span lang="EN-US"><font face="Times New Roman">HTTP</font></span><span style="font-family: 瀹嬩綋;">媧誨姩瓚呮椂闄愬埗鐨勬椂闂村お鐭?</span></font><span><strong><span id="o4eywa4" class="guitag1">HTTP Keep-Alive Timeout</span></strong></span><span style="font-size: 10.5pt; font-family: Arial;" lang="EN-US">.<br /><br />6,InputStream is =formFile.getInputStream() ;聽 //formFile鏄痮rg.apache.struts.upload.FormFile<br />涓婁紶鐨勬枃浠跺皬鏃惰繖涓緭鍏ユ祦鏄痡ava.io.ByteArrayInputStream錛屼笂浼犳瘮杈冨ぇ鐨勬枃浠舵椂榪欎釜杈撳叆嫻佹槸FileInputStream<br /><br />7,璁劇疆琛ㄥ崟閲岀殑涓婁紶璺緞涓哄彧璇?br /><input type=file id="uploadfile" name="uploadfile" style="display: none;"><br /><input type=text id=tempfile readonly="true"><br /><input type=button <br />onClick="uploadfile.click();tempfile.value=uploadfile.value;" value="嫻忚.."><br /><br />10,<br />http://eastpoint.javaeye.com/blog/99084<br />http://topic.csdn.net/u/20080131/13/649c57c7-204e-4bb6-9b09-49cca39f00b8.html<br />http://blog.niwota.com/nb/chenchuang?cat_self_id=291075<br /></span><img src ="http://www.tkk7.com/leekiang/aggbug/139844.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/leekiang/" target="_blank">leekiang</a> 2007-08-27 11:58 <a href="http://www.tkk7.com/leekiang/archive/2007/08/27/139844.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://caita88.com" target="_blank">一个人免费视频在线观看www</a>| <a href="http://714747.com" target="_blank">亚洲国产精品第一区二区</a>| <a href="http://zanyoo.com" target="_blank">久久精品熟女亚洲av麻豆</a>| <a href="http://cc006.com" target="_blank">亚洲综合色成在线播放</a>| <a href="http://kj555888.com" target="_blank">精品无码国产污污污免费网站 </a>| <a href="http://www282pp.com" target="_blank">51精品视频免费国产专区</a>| <a href="http://by22877.com" target="_blank">亚洲偷自精品三十六区</a>| <a href="http://ycjs999.com" target="_blank">av在线亚洲欧洲日产一区二区</a>| <a href="http://416164.com" target="_blank">亚洲日本va在线观看</a>| <a href="http://yy1288.com" target="_blank">亚洲狠狠爱综合影院婷婷</a>| <a href="http://2828228.com" target="_blank">又大又硬又爽又粗又快的视频免费</a>| <a href="http://www-474749.com" target="_blank">亚洲精品尤物yw在线影院</a>| <a href="http://hbwhgd.com" target="_blank">99爱在线观看免费完整版</a>| <a href="http://av-fantasy.com" target="_blank">国产综合激情在线亚洲第一页</a>| <a href="http://cin17.com" target="_blank">精品国产免费观看一区</a>| <a href="http://3fsf.com" target="_blank">国产在线观看免费视频软件</a>| <a href="http://tc116.com" target="_blank">亚洲国产成人精品无码区在线网站</a>| <a href="http://5656ys.com" target="_blank">日韩人妻一区二区三区免费</a>| <a href="http://zhuanjiao521.com" target="_blank">亚洲av永久无码精品网址</a>| <a href="http://ttvv55.com" target="_blank">久久亚洲国产精品成人AV秋霞 </a>| <a href="http://kanboy.com" target="_blank">色老头综合免费视频</a>| <a href="http://33uub.com" target="_blank">亚洲精品**中文毛片</a>| <a href="http://cndianxian.com" target="_blank">亚洲人成电影网站国产精品</a>| <a href="http://1314xxx.com" target="_blank">18禁成年无码免费网站无遮挡 </a>| <a href="http://fjwkjx.com" target="_blank">精品一区二区三区免费毛片</a>| <a href="http://yuyang0752.com" target="_blank">亚洲欧洲∨国产一区二区三区</a>| <a href="http://zf91.com" target="_blank">成人精品一区二区三区不卡免费看</a>| <a href="http://6363388.com" target="_blank">亚洲一区二区三区无码中文字幕</a>| <a href="http://jinmenonline.com" target="_blank">成人网站免费大全日韩国产</a>| <a href="http://dstbxg.com" target="_blank">亚洲一区二区三区丝袜</a>| <a href="http://www-44455588.com" target="_blank">亚洲av最新在线网址</a>| <a href="http://chaoxung.com" target="_blank">免费成人午夜视频</a>| <a href="http://wwwseselu.com" target="_blank">国内一级一级毛片a免费</a>| <a href="http://wkk3.com" target="_blank">久久WWW免费人成一看片</a>| <a href="http://180xiu.com" target="_blank">免费观看成人久久网免费观看</a>| <a href="http://haiholr.com" target="_blank">亚洲成电影在线观看青青</a>| <a href="http://daohang123456.com" target="_blank">亚洲国产中文v高清在线观看</a>| <a href="http://1178767.com" target="_blank">国产午夜无码精品免费看</a>| <a href="http://19520888.com" target="_blank">一区二区三区AV高清免费波多</a>| <a href="http://19933k.com" target="_blank">亚洲精品制服丝袜四区</a>| <a href="http://mtsp2.com" target="_blank">亚洲情a成黄在线观看</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>