Browse Source

File uploading

Harry Hedger 8 years ago
parent
commit
9393c8b8fd
2 changed files with 9 additions and 2 deletions
  1. 1 1
      src/core/UppySocket.js
  2. 8 1
      src/plugins/GoogleDrive/index.js

+ 1 - 1
src/core/UppySocket.js

@@ -5,7 +5,7 @@ export default class UppySocket {
     this.queued = []
     this.isOpen = false
     this.socket = new WebSocket(opts.target)
-    this.emitter = new ee.EventEmitter()
+    this.emitter = ee()
 
     this.socket.onopen = (e) => {
       this.isOpen = true

+ 8 - 1
src/plugins/GoogleDrive/index.js

@@ -200,10 +200,17 @@ export default class Google extends Plugin {
       isRemote: true,
       body: {
         fileId: file.id
+      },
+      remote: {
+        host: this.opts.host,
+        url: `${this.opts.host}/google/get?fileId=${file.id}`,
+        body: {
+          fileId: file.id
+        }
       }
     }
     console.log('adding file')
-    this.core.emitter.emit('file-add', tagFile)
+    this.core.emitter.emit('core:file-add', tagFile)
   }
 
   handleError (response) {