jQuery File Upload preview image

前端 未结 3 1529
我在风中等你
我在风中等你 2021-01-31 12:03

I am using jQuery File Upload plugin (http://blueimp.github.io/jQuery-File-Upload/) for image upload for my website. I have look through (https://github.com/blueimp/jQuery-File-

3条回答
  •  无人共我
    2021-01-31 12:07

    The plugin does support image previews though I'm trying to figure out how to resize it to a higher resolution. You can access the preview by doing something like this:

    $('.fileupload-field')
      .fileupload({
         disableImageResize: false, 
         previewMaxWidth: 320, 
         previewMaxHeight: 320
      })
      .bind('fileuploadprocessalways', function(e, data)
      {
          var canvas = data.files[0].preview;
          var dataURL = canvas.toDataURL();
          $("#some-image").css("background-image", 'url(' + dataURL +')');
    
      })
    

提交回复
热议问题