{"action":"created","issue":{"url":"https://api.github.com/repos/tomitrescak/meteor-uploads/issues/148","labels_url":"https://api.github.com/repos/tomitrescak/meteor-uploads/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/tomitrescak/meteor-uploads/issues/148/comments","events_url":"https://api.github.com/repos/tomitrescak/meteor-uploads/issues/148/events","html_url":"https://github.com/tomitrescak/meteor-uploads/issues/148","id":105444379,"number":148,"title":"formData not passing updated Session var","user":{"login":"warrichrepos","id":1776577,"avatar_url":"https://avatars.githubusercontent.com/u/1776577?v=3","gravatar_id":"","url":"https://api.github.com/users/warrichrepos","html_url":"https://github.com/warrichrepos","followers_url":"https://api.github.com/users/warrichrepos/followers","following_url":"https://api.github.com/users/warrichrepos/following{/other_user}","gists_url":"https://api.github.com/users/warrichrepos/gists{/gist_id}","starred_url":"https://api.github.com/users/warrichrepos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrichrepos/subscriptions","organizations_url":"https://api.github.com/users/warrichrepos/orgs","repos_url":"https://api.github.com/users/warrichrepos/repos","events_url":"https://api.github.com/users/warrichrepos/events{/privacy}","received_events_url":"https://api.github.com/users/warrichrepos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-08T18:35:48Z","updated_at":"2015-10-01T23:49:45Z","closed_at":null,"body":"Hi, I'm having a problem getting formData to pass the correct data from a session variable. This is a wonderful package and this seems to be my only problem.\r\n\r\nAfter my template loads, the initial value of formData 'myfolder' is set initially to nothing. When the session value changes via a select input option and I upload a file, it never uses the updated value from the session. I see from an example from above that this should work, but it does not. I'm sure I'm doing something wrong somewhere but I can't see where. If anyone could help or provide me with a clue that would be fantastic. Thanks again for the wonderful package.\r\n\r\n[client]\r\nTemplate.uploader.helpers({\r\n   specificFormData: function() {\r\n      \r\n      var myfolder = Session.get('currentFolder');\r\n     \r\n      return {\r\n        owner: Meteor.userId(),\r\n        folder: myfolder        \r\n      }\r\n    },\r\n\r\n[server]\r\nif (Meteor.isServer) {\r\n  Meteor.startup(function () {\r\n    // code to run on server at startup\r\n    \r\n    UploadServer.init({\r\n      tmpDir: process.env.PWD + '/.uploads/tmp',\r\n      uploadDir: process.env.PWD + '/.uploads/',\r\n      checkCreateDirectories: true, \r\n\r\n      imageVersions: {thumbnailBig: {width: 400, height: 300}, thumbnailSmall: {width: 200, height: 100}},\r\n\r\n      getDirectory: function(fileInfo, formData) {\r\n        \r\n        console.log('fileInfo:', fileInfo);\r\n        console.log('formData:', formData);\r\n        return formData.owner + '/' + formData.folder;\r\n      },\r\n}"},"comment":{"url":"https://api.github.com/repos/tomitrescak/meteor-uploads/issues/comments/144879599","html_url":"https://github.com/tomitrescak/meteor-uploads/issues/148#issuecomment-144879599","issue_url":"https://api.github.com/repos/tomitrescak/meteor-uploads/issues/148","id":144879599,"user":{"login":"tomitrescak","id":2682705,"avatar_url":"https://avatars.githubusercontent.com/u/2682705?v=3","gravatar_id":"","url":"https://api.github.com/users/tomitrescak","html_url":"https://github.com/tomitrescak","followers_url":"https://api.github.com/users/tomitrescak/followers","following_url":"https://api.github.com/users/tomitrescak/following{/other_user}","gists_url":"https://api.github.com/users/tomitrescak/gists{/gist_id}","starred_url":"https://api.github.com/users/tomitrescak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomitrescak/subscriptions","organizations_url":"https://api.github.com/users/tomitrescak/orgs","repos_url":"https://api.github.com/users/tomitrescak/repos","events_url":"https://api.github.com/users/tomitrescak/events{/privacy}","received_events_url":"https://api.github.com/users/tomitrescak/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T23:49:45Z","updated_at":"2015-10-01T23:49:45Z","body":"Ok, since you guys seem like you really need this soon, I put a new verion online 2.2.0 that has the possibility to dunamically change the formData. I have also updated the documentation which reads following:\r\n\r\nIf you have several different upload controls on a page and you can execute different callbacks by passing them to the template:\r\n\r\n```html\r\n<template name=\"home\">\r\n    {{> upload_bootstrap callbacks=myCallbacks }}\r\n</template>\r\n```\r\n\r\nAnd then pass the finished in the callback from helper\r\n\r\n```javascript\r\nTemplate.home.helpers({\r\n  myCallbacks: function() {\r\n    return {\r\n        formData: function() { return { id: \"232323\", other: Session.get(\"ReactiveParam\") } },\r\n        finished: function(index, fileInfo, context) { ... },\r\n        ...\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nI hope this help. Please close the issue if it does."}}