       file = parentData
     else
       return null
-    console.log(file)
+
     if file != '' && file
       if file.length == 17
           # No subscription

    atts
  fileUpload: ->
    af = Template.parentData(1)._af
    # Template.parentData(4).value

    name = @atts.name
    uploader = new Slingshot.Upload(@)

Template.afSlingshot.events
  "change .file-upload": (e, t) ->
    files = e.target.files
    uploader = new Slingshot.Upload(t.data.atts.slingshotdirective)
    files = event.target.files
    if t.data.atts.onBeforeUpload
      files = t.data.atts.onBeforeUpload(files)
    uploader.send files[0], (err, downloadUrl)->
      if err
        console.log err
      else
        name = $(e.target).attr('file-input')
        $('input[name="' + name + '"]').val(downloadUrl)
        Session.set 'fileUploadSelected[' + name + ']', files[0].name
        refreshFileInput name
  'click .file-upload-clear': (e, t)->
    name = $(e.currentTarget).attr('file-input')
