简体   繁体   English

AWS S3 Direct Upload Javascript故障

[英]AWS S3 Direct Upload Javascript failure

I manage a site written in Ruby on Rails, Javascript, and C that's been up for a few years, and allows users to upload data files that we process. 我管理着一个用Ruby on Rails,Javascript和C编写的网站,该网站已经运行了几年,并且允许用户上载我们处理的数据文件。 I use the s3_direct_upload gem to bypass our web server and process the file asynchronously, providing progress updates to the client. 我使用s3_direct_upload gem绕过我们的Web服务器并异步处理文件,从而为客户端提供进度更新。

Recently we have a user that is no longer able to upload files though he had been able to in the past. 最近,我们有一个用户过去不能再上传文件了。 No other users are experiencing the issue. 没有其他用户遇到此问题。 He is running Chrome on Windows, and thankfully was willing to get a screen print of the Java console when the error occurs. 他在Windows上运行Chrome,并且很高兴在发生错误时愿意获得Java控制台的屏幕打印。 It is below. 在下面。

在此处输入图片说明

The Javascript code in question is as follows with the error getting called on s3_upload_failed , content.filename has the correct filename, and content.error_thrown is blank: 有问题的Javascript代码如下,错误在s3_upload_faileds3_upload_failedcontent.filename具有正确的文件名,而content.error_thrown为空白:

$(document).ready(function() {
  var upload_names = [];

  $('#new_ride_menu, #new_ride_button').S3Uploader(
    {
      remove_completed_progress_bar: false,
      progress_bar_target: $('.ride-upload-progress'),
      before_add: validateFile,
      expiration: null
    }
  );
  $('#new_ride_menu, #new_ride_button').bind('s3_uploads_start', function(e, content) {
    $('#ride-upload-modal').appendTo('body').modal('show');
  });
  // one upload is complete
  $('#new_ride_menu, #new_ride_button').bind('s3_upload_complete', function(e, content) {
    upload_names.push(content.file);
  });
  // all uploads are complete
  $('#new_ride_menu, #new_ride_button').bind('s3_uploads_complete', function(e, content) {
    // HANDLE SERVER COMMS AND PROCESSING
  });
  $('#new_ride_menu, #new_ride_button').bind('s3_upload_failed', function(e, content) {
    $.post('/logs', {level: 'warn', message: 'Error uploading file: '+content.filename});
    return alert(content.filename + ' failed to upload');
  });
});

I'm attempting to replicate this error with no success. 我正在尝试复制此错误,但没有成功。 I've tried: 我试过了:

  • Disabling Javascript 禁用JavaScript
  • Disabling cookies 禁用cookie
  • Blocking third party cookies 阻止第三方Cookie
  • Turned off unsandboxed plugin access 关闭非沙盒插件访问
  • Turned off clipboard access 关闭剪贴板访问

Does this set of errors look familiar to anyone? 这组错误看起来对任何人都熟悉吗? Is this a client side configuration issue? 这是客户端配置问题吗? Any direction would be greatly appreciated. 任何方向将不胜感激。

After being unable to diagnose with more info, I got on the phone with the customer and asked them to bring up the site on IE. 无法诊断更多信息后,我与客户通电话,要求他们在IE上打开该网站。 That worked and therefore proved something was amiss with Chrome. 那行得通,因此证明Chrome有点不对劲。

Turns out they were using two Chrome instances, one for work and one for home. 原来他们使用的是两个Chrome实例,一个用于工作,另一个用于家庭。 The home version played nicely with my site, however the work version had some very restrictive options. 家用版在我的网站上玩得很好,但是工作版有一些非常严格的选择。 In the end, the solution was to make sure the customer was using their home version of Chrome. 最后,解决方案是确保客户使用的是家庭版Chrome。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM