Ver código fonte

HUE-7502 [aws] upload file to s3 location throws error: undefined

jdesjean 8 anos atrás
pai
commit
f7cd3d2

+ 6 - 2
desktop/core/src/desktop/static/desktop/ext/js/fileuploader.js

@@ -1027,7 +1027,9 @@ qq.extend(qq.UploadHandlerForm.prototype, {
         return this._inputs[id].value.replace(/.*(\/|\\)/, "");
     },
     _cancel: function(id){
-        this._options.onCancel(id, this.getName(id));
+        if (this._inputs[id]) {
+          this._options.onCancel(id, this.getName(id));
+        }
 
         delete this._inputs[id];
 
@@ -1295,7 +1297,9 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
         this._dequeue(id);
     },
     _cancel: function(id){
-        this._options.onCancel(id, this.getName(id));
+        if (this._files[id]) {
+          this._options.onCancel(id, this.getName(id));
+        }
 
         this._files[id] = null;
 

+ 4 - 0
desktop/libs/aws/src/aws/s3/s3fs.py

@@ -512,3 +512,7 @@ class S3FileSystem(object):
 
   def setuser(self, user):
     pass  # user-concept doesn't have sense for this implementation
+
+  def get_upload_chuck_size(self):
+    from hadoop.conf import UPLOAD_CHUNK_SIZE # circular dependency
+    return UPLOAD_CHUNK_SIZE.get()