Dropzone.js无法在safari或mac

时间:2016-03-28 07:00:20

标签: javascript php jquery laravel-5.1 dropzone.js

我在laravel 5.1中使用Dropzone,但是它在firefox中工作,在windows中使用chrome。一旦在Mac中运行,Failed to load resource: the server responded with a status of 500 (Internal Server Error)

就会出现响应错误

php代码有什么问题吗?

我写了以下javascript代码:

var dropZone = new Dropzone($(".dropzone").get(0),{
          url: BASE_URL+'user/board/uploadimages',
          uploadMultiple: true,
          parallelUploads: 100,
          maxFiles: 100,
          maxFilesize: 5,
          dictFileTooBig: 'Image is bigger than 5MB',
          addRemoveLinks: false,
          autoProcessQueue: true,
          dictDefaultMessage: "<label class='dropzone-message-container'><i class='fa fa-cloud-upload'></i><div class='clearfix'></div> Drop images to upload</label>",
          acceptedFiles: ".jpeg,.jpg,.png,.gif,.JPEG,.JPG,.PNG,.GIF",
          init: function()
          {
              thisDropzone = this;

            this.on('sending', function(file, xhr, formData){
              hiddenBoardID = $("#dropZone .hiddenBoardID").val();
              formData.append('hiddenBoardID', hiddenBoardID);
            });
            this.on('thumbnail', function(file) {
              console.log(file.width);
                if ( file.width < 1000) {
                  file.rejectDimensions();
                }
                else {
                  file.acceptDimensions();
                }
            });
            this.on("success",function(file, response){


              if(response.success){
                 toastr.success(response.message,"Success");
                 setTimeout(function(){
                     dropZone.removeFile(file);
                     $("#dropZone").modal("hide");
                 },2000);
                $("#imageListing .image-container").empty().html(response.html);
              }else{
                toastr.warning(response.message,"Error");
              }
            });
            this.on("complete", function(file) {
            });
            this.on("queuecomplete", function (file) {
            });

          },
          accept: function(file, done) {
            file.acceptDimensions = done;
            file.rejectDimensions = function() {
              done('The image must be at least 1000 pixels in width');
            };
          },
        }); 

当我尝试在mac上传图片时,请检查以下图片。

enter image description here

我在dropzone.js官方网页上也有检查代码,但很热,找出这个问题。

请帮助解决此问题。

0 个答案:

没有答案