2012-01-07 3 views
0

을 감안할 때 런타임 실버 을 가진 확인 내가 업로드 버튼 을 클릭 아무것도plupload - HTML5와 플래시

는 HTML5와 플래시 잘 작동 발생하지 않습니다. 나는 철저하게 테스트하고 있는데, IE가 plupload flash (컨테이너가 설정되지 않았다. IE가 이상하게 작동하지 않는다.)에 버그가 없다는 것을 확인하기 위해 실버 라이트를 런타임으로만 테스트했다. 슬프게도이 침묵 오류가 발생했다. IT는 FF, Chrome on Mac 또는 Windows의 IE9에서 작동하지 않습니다. 내가 백본 및 커피 스크립트 (레일 3 응용 프로그램) 을 사용하고

이 내가 class window.Uploader extends Backbone.View 내 plupload를 구성하는 방법입니다. 이 런타임으로 플래시와 HTML5와 함께 작동 기억이 내 _form.html.erb (HAML를 사랑하지 않는 용서) 주석의 요청에 따라 HTML을 생성

<div id="upload_container" class="clearfix"> 
    <div class='input'> 
    <div class='clearfix'> 
     <%=activity_image @activity%> 
    </div> 
    <%=link_to "Choose Picture", '#', :id => "pickfiles", :class => "btn small"%> 
    <div class='clearfix' id='filelist'> 
    </div> 
    </div> 
</div> 

initialize: (options) -> 
    @uploader = new plupload.Uploader({ 
    runtimes : 'silverlight,flash', #'gears,html5,flash,silverlight,browserplus', 
    browse_button : 'pickfiles', 
    container: 'upload_container' 
    max_file_size : '5mb', 
    url : "/admin/upload", 
    flash_swf_url : '/publiclib/plupload.flash.swf', 
    silverlight_xap_url : '/publiclib/plupload.silverlight.xap', 
    filters : [ {title: "#{filter_title} ", extensions : "#{filter_extentions}"}] 
    multi_selection: that.multiple, 
    multipart: true, 
    multipart_params: { 
     "authenticity_token" : FORM_AUTH_TOKEN 
    }, 
    file_data_name: 'photo' 
    }) 

    ###### THIS PRINTS SILVERLIGHT as runtime, in all browser I've tested for this Q 
    ###### So it is used/detected, but not working 
    @uploader.bind 'Init', (up, params) -> 
    $('#filelist').html("<div>Current runtime: #{params.runtime} </div>") 

    @uploader.init() 
    @setupBindings() 

setupBindings: -> 
    #instantiates the uploader 
    that = @ 

    # shows the progress bar and kicks off uploading 
    @uploader.bind 'FilesAdded', (up, files) -> 
    _.each files, (file) -> 

     $('#filelist').append('<div id="' + file.id + '"><small>' + file.name + ' (' + plupload.formatSize(file.size) + ') </small><b></b>' + '<div class=" percent label notice" style="width:10%;"><span>Laster opp</span></div></div>') 

    that.uploader.start() 

    #binds progress to progress bar 
    @uploader.bind 'UploadProgress', (uploader, file) -> 
    # .. some upload code, not relevant to Q 

입니다 ... :

<fieldset> 
    <input id="activity_photo_id" name="activity[photo_id]" size="30" style="display:none;" type="text" /> 

<legend>choose picture for upload</legend> 
<div id="upload_container" class="clearfix"> 

    <div class='input'> 
    <div class='clearfix'> 
     <img src='/assets/default_photo.png' id='image_preview'> 
    </div> 
    <a href="#" class="btn small" id="pickfiles">Choose Picture</a> 
    <div class='clearfix' id='filelist'></div> 
    </div> 
</div> 
</fieldset> 

"그림 선택"을 클릭해도 아무런 변화가 없습니다. 당신의 스타일 Plupload 구조에 따라 plupload 1.5.1.1

+0

아마 생성 된 HTML을 포함시킬 수 있습니까? – thejh

+0

포함. 당신은 실버 라이트 plupload의 작동 impl 무엇입니까? Silverlight가 upload_container 또는 버튼에 바인딩되지 않는다고 생각합니다. 클릭 할 때 아무 일도 일어나지 않기 때문입니다. 실버 라이트가 듣는 곳을 어떻게 찾을 수 있습니까? – oma

+0

컨트롤이 iframe에있을 가능성이 있습니까? IE7/6 모두 플래시 또는 실버 라이트 플러그인이있는 iframe 내부에 문제가 있습니다. 일단 iframe에서 꺼내 인라인으로 사용하면 제대로 작동합니다. –

답변

0

은 컨테이너 (#upload_container)에서 길을 잃을 수 있습니다. browse_button 요소를 자체 컨테이너에 랩핑하여 화면에 엄격한 위치를 지정하십시오.

Plupload와 Backbone/CoffeeScript간에 약간의 충돌이있을 수 있습니다. 여기서 작동하는 독립 실행 형 제품이므로 테스트가 완료되었습니다. 어딘가 온라인으로 사용 사례를 보여줄 수 있습니까?

+0

IE8에서 오류가 계속 발견되었습니다. 당신이 제안한 것을 시도해 볼게요. – oma

+0

내 '@uploader.bind 'Init''는 IE8에서 페이지를로드 할 때 트리거되지 않습니다. IE8에서는 "현재 런타임은 .."이 표시되지 않습니다. – oma

+0

나는 더 이상 당신을 도울 수는 있지만 정말로 당신의 경우를 볼 필요가 있습니다. 다시 말하자면 독립 실행 형 케이스로서 모든 IE에서 작동합니다. 그런데 Plupload의 사이트 (http://plupload.com/example_all_runtimes.php)의 예제가 IE8에서 작동합니까? – jayarjo