What are the difference between using an AJAX or JQuery upload plugin vs. using a Flash upload plugin for browser uploads, especially as it relates to the uploadin开发者_如何学编程g of very large fies (1-2GB). Is there any reason to go with one over the other? Thank you.
and I recomend plupload.
it supports several "runtimes" (engines) like html5, silverlight, flash at the same time, which is nice, as if the client browser doesn't support the prefered engine, it will try to use the the next one in the list, until one is supported. And it degrates nicely (by example if the browser doesn't support html5 or silverlight, html4 will be used, but without multifile support).
here is an exemple how you can init it for large files
uploader = new plupload.Uploader({
//runtimes : 'gears,html5,flash,silverlight,browserplus',
runtimes : 'html5,gears,flash,silverlight,html4,browserplus',
browse_button : 'pickfiles',
max_file_size : '4000mb',
chunk_size : '1mb',
unique_names : true,
url : '/fileTransfer/upload.php',
resize : {width : 320, height : 240, quality : 90},
flash_swf_url : '/modules/jquery/plugins/plupload/js/plupload.flash.swf',
silverlight_xap_url : '/modules/jquery/plugins/plupload/js/plupload.silverlight.xap',
drop_element : 'dropBox'
of course, you need to load them in your page, like that:
<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.gears.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.silverlight.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.flash.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.browserplus.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.html4.js"></script>
<script type="text/javascript" src="/modules/jquery/plugins/plupload/js/plupload.html5.js"></script>
For large files, you would really need progressbar and flash comes handy there.
And yes, you can show some sort of progressbar using pure javascript/jquery but it wont be as smooth as one with flash capabilities.
I am not taking sides here, but I find Uploadify / SWFUpload much smoother than NeatUpload for instance.
I would recommend using Uploadify, but thats just me.
精彩评论