diff --git a/imports/startup/server/aws.js b/imports/startup/server/aws.js index 3344b80..bdee1f6 100755 --- a/imports/startup/server/aws.js +++ b/imports/startup/server/aws.js @@ -25,7 +25,7 @@ Meteor.startup(() => { }, key: function (file, metaContext) { // image url with ._id attached: - return metaContext.uploaderId + "/" + Date.now() + "-" + file.name.replace(/\s/g, '_'); + return metaContext.uploaderId + "/" + metaContext.folder + '/' + Date.now() + "-" + file.name.replace(/\s/g, '_'); } }); }); diff --git a/imports/ui/components/expenses/ExpensesSideBar.jsx b/imports/ui/components/expenses/ExpensesSideBar.jsx index 186af4d..76a5ed3 100755 --- a/imports/ui/components/expenses/ExpensesSideBar.jsx +++ b/imports/ui/components/expenses/ExpensesSideBar.jsx @@ -303,6 +303,7 @@ class ExpensesSideBar extends Component { reader.readAsDataURL(file); let metaContext = { + folder: "bills", uploaderId: userId }; diff --git a/imports/ui/components/settings/Settings.jsx b/imports/ui/components/settings/Settings.jsx index 342f91f..563964c 100755 --- a/imports/ui/components/settings/Settings.jsx +++ b/imports/ui/components/settings/Settings.jsx @@ -207,9 +207,9 @@ class SettingsPage extends Component { let userId = Meteor.user()._id; let metaContext = { + folder: "profiles", uploaderId: userId }; - let uploader = new Slingshot.Upload('imageUploader', metaContext); uploader.send(this.state.target, (error, downloadUrl) => { // you can use refs if you like if (error) { @@ -277,7 +277,6 @@ class SettingsPage extends Component { target: e.target.files[0] }) reader.onload = (upload) => { - console.log(upload); this.setState({ data_uri: upload.target.result });