Differential / meteor-uploader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: be able to specify a filename to the files

opened this issue · comments

Hi,

I'm looking for a way to specify a filename to the files I'm uploading to S3.

I noticed that here you are passing an empty doc to the constructor, are you planning to open it up to the callbacks (possibly manipulateImage), so that we can specify the filename? Or you passed an empty doc deliberately due to some reason I completely missed?

I'd like to know your opinion on this.

Thank you very much.

Great updates btw.

I figured out a quick way to do this, but it requires to clone the project and modify lib/UploaderFile.coffe. In the upload method I simply check if the settings contain an id and use that to construct the filename on S3 side

  UploaderFile::upload = (filePath) ->
    config = Uploader.getConfig()
    knox = Knox.createClient config

    if @settings.id?
      cloudPath = "#{@settings.id}#{@ext}"
    else
      cloudPath = "#{@id}#{@ext}"

....