파일 업로드 uploadify 플러그 인 사용
                                            
 6686 단어  JavaScriptPHP브 라 우 저각본Flash
                    
http://www.cnblogs.com/Lewis/archive/2010/04/27/1722024.html
    Uploadify       :
 uploader : uploadify.swf        , swf         BROWSE   ,            ,   :uploadify.swf。
  script :             。   :uploadify.php
  checkScript :                               
  fileDataName :      ,                       。   Filedata
  method :     Post  Get    Post
  scriptAccess :flash         ,          always,   :sameDomain
  folder :           。
  queueID :      ID, ID        div ID  。
  queueSizeLimit :          ,         ,   :999 。
  multi :    true         。
  auto :    true            , false            。
  fileDesc :          fileExt      ,                 ,   fileDesc “   rar doc pdf  ”,            :
  fileExt :             ,   :'*.doc;*.pdf;*.rar' 。
  sizeLimit :           。   102400
  simUploadLimit :              :1 。
  buttonText :        ,   :BROWSE 。
  buttonImg :            。
  hideButton :    true           。
  rollover :   true false,   true                 。
  width :           ,   :110。
  height :           ,   :30。
  wmode :      transparent         flash      ,  flash            。    :opaque 。
  cancelImg :                         
	onInit :          。
	onSelect :       ,        
		* event:    。
		* queueID:       , 6       。
		* fileObj:       , name、size、creationDate、modificationDate、type 5   。 
		
	onSelectOnce :           ,       。        event,data,data         :
	fileCount:       。
	filesSelected:         ,       3        3。
	filesReplaced:           A B    ,           A B,     2。
	allBytesTotal:           。
	 
	onCancel :                          。    event、queueId、fileObj、data    ,       onSelect       ,data       fileCount allBytesTotal。
	fileCount:       ,            。
	allBytesTotal:       ,            。
	 
	onClearQueue :     fileUploadClearQueue   。 event data    , onCancel         。
	onQueueFull :    queueSizeLimit            queueSizeLimit     。        event queueSizeLimit。
	onError :             。    event、queueId、fileObj、errorObj    ,         ,errorObj   type info    。
	type:     ,   ‘HTTP’, ‘IO’, or ‘Security’
	info:     
 
	onOpen :       ,  auto   true         ,                  。    event、queueId、fileObj    ,       。
	onProgress :       ,  auto   true         ,                  , onOpen    。     event、queueId、fileObj、data    ,          。data       percentage、 bytesLoaded、allBytesLoaded、speed:
	percentage:        
	bytesLoaded:       
	allBytesLoaded:             
	speed:     kb/s
 
		onComplete:         。        event、queueId、fileObj、response、data    ,       。response           ,        1 0,data     fileCount speed
	fileCount:              。
	speed:          kb/s
	 :fileObj              ,onComplete  fileObj    filePath             。
 
	onAllComplete:                 。    event data    ,data     ,   :
	filesUploaded :         。
	errors :       。
	allBytesLoaded :          。
	
------------------------------------------------------------------------
uploadifySettings:             key ,     
  $('#uploadify').uploadifySettings('folder','JS'); 
	
<a href="javascript:$('#uploadify').uploadifySettings('folder','JS');$('#uploadify').uploadifyUpload()">  </a>
  uploadifyCancel:       queueID    ,           queueID   。
  
  $('#uploadify').uploadifyCancel(id); 
--------------------------------------------------------------------------
----------------------------------------------------------------------------
    :
       
     ,      ,  buttonImg(     ),                          flash    ,            ,
       wmode       opaque,    transparent   ,             
   1.
      <script type="text/javascript">
      $(document).ready(function() {
      $("#uploadify").uploadify({
      'uploader' : 'images/uploadify.swf',
      'script' : '<%=request.getContextPath()%>/content/ImportScheduleCommitAction.do',
      'cancelImg' : 'images/cancel.png',
      'folder' : '/',
      'queueID' : 'fileQueue',
      'fileDataName' : 'uploadify',
      'fileDesc' : '    :xls.',
      'fileExt' : '*.xls',
      'auto' : false,
      'multi' : true,
      'height' : 20,
      'width' : 50,
      'simUploadLimit' : 3,
      //'buttonText' : 'fdsfdsf...',
      'buttonImg' : 'images/browse.jpg',
      // 'hideButton' : true,
      // 'rollover' : true,
      'wmode' : 'transparent' ,
      onComplete : function (event, queueID, fileObj, response, data)
      {
      $('<li></li>').appendTo('.files').text(response);
      },
      onError : function(event, queueID, fileObj)
      {
      alert("  :" + fileObj.name + "     ");
      }
      // onCancel : function(event, queueID, fileObj)
      // {
      // alert("    :" + fileObj.name);
      // }
      });
2、
	  
	  
        'onInit':function(){alert("1");},
        'onSelect': function(e, queueId, fileObj)
        {
            alert("    :" + queueId + "\r
" +
                  "   :" + fileObj.name + "\r
" +
                  "    :" + fileObj.size + "\r
" +
                  "    :" + fileObj.creationDate + "\r
" +
                  "      :" + fileObj.modificationDate + "\r
" +
                  "    :" + fileObj.type
            );
        }
		
		
3. flash utf8  ,               ,move_uploaded_file($tempFile,iconv(“UTF-8″,”gb2312″, $targetFile));
4。 session            ,   scriptData :{'id':1}
		
                이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
기초 정리 - 1문자 (String) 숫자 (Number) 불린 (Boolean) null undefined 심볼 (Symbol) 큰정수 (BigInt) 따옴표로 묶어 있어야 함 Not-A-Number - 숫자 데이터 / 숫자로 표...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.