BLUE-8: Modified the upload/analysis functionality to work strictly with local files, so only the final results are uploaded to OpenStack, saving on bandwidth

This commit is contained in:
Andy Heathershaw
2016-10-28 05:30:57 +01:00
parent 9141398da8
commit aadc39684f
8 changed files with 97 additions and 78 deletions

View File

@@ -434,11 +434,12 @@ function StorageLocationsViewModel() {
/**
* This model is used by admin/show_album.blade.php to handle photo uploads.
* @param album_id ID of the album the photos are being uploaded to
* @param queue_token Unique token of the upload queue to save the photos to
* @param language Array containing language strings
* @param urls Array containing URLs
* @constructor
*/
function UploadPhotosViewModel(album_id, language, urls) {
function UploadPhotosViewModel(album_id, queue_token, language, urls) {
var self = this;
self.currentStatus = ko.observable('');
@@ -510,6 +511,7 @@ function UploadPhotosViewModel(album_id, language, urls) {
self.uploadFile = function uploadImageFile(formObject, imageFile) {
var formData = new FormData();
formData.append('album_id', album_id);
formData.append('queue_token', queue_token);
formData.append('photo[]', imageFile, imageFile.name);
$.ajax(