From 3c2a152af0d37fd687198f56819b05f389996bc1 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Sun, 24 Jul 2016 00:49:57 +0200
Subject: rhimportd uses a different file upload now


diff --git a/README b/README
index 79db43c..1cc687f 100644
--- a/README
+++ b/README
@@ -71,9 +71,9 @@ add the following to the virtualhost config:
 		</Files>
 	</Directory>
 
-	ProxyPass "/ntp"        "ws://localhost:3000/ntp"
-	ProxyPass "/rhimportd"  "ws://localhost:4080/public/socket"
-	ProxyPass "/upload"     "http://localhost:4080/public/upload"
+	ProxyPass "/ntp"  	"ws://localhost:3000/ntp"
+	ProxyPass "/rhimportd"	"ws://localhost:4080/public/socket"
+	ProxyPass "/upload/"	"http://localhost:4080/public/upload/"
 
 	DocumentRoot /var/www/rhwebimport/www/
 	<Directory /var/www/rhwebimport/>
diff --git a/www/js/importer.js b/www/js/importer.js
index 2a96ff7..8bc525e 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -376,18 +376,18 @@ Rdxport.Upload.prototype.onmessage = function(event) {
       console.log(data);
       if (this.file && !this.sendingFile) {
         this.sendingFile = true;
-
-        // todo: post request goes here.
-        /*var command = {
-          LOGIN_NAME: this.username,
-          SESSION_ID: data.ID,
-          FILENAME: 'filename!',
-          data: self.file,
-          mimeTypes:"multipart/form-data"
+        
+        var command = {
+          type: "POST",
+          contentType: "application/octet-stream",
+          data: this.file,
+          processData: false,
+          dataType: 'json',
+          error: function(req, status, err) { console.log({StatusText: status, ErrorString: err}); },
+          success: function(data, status, req) { console.log(data); }
         };
-        return $.post('https://import.helsinki.at/upload', command);*/
+        $.ajax('https://import.helsinki.at/upload/' + importer.username + '/' + data.ID, command);
       }
-
       this.group.fetchCarts();
       this.groupView.uploadProgress(this);
       break;
-- 
cgit v0.10.2