How do I pass a variable for naming files in slingshot?

How do I pass a variable myvar from the event to key for naming the file in slingshot?

Slingshot.createDirective(“slingUpload”, Slingshot.S3Storage, {

key: function (file) {
return + “" + myvar + "” +;


Is there a way to get the file object using just slingshot and raix:ui-dropped-event? Now I use FS.Utility.eachFile to get it.

I solved the first question, how to pass a variable.