s3_direct_upload icon indicating copy to clipboard operation
s3_direct_upload copied to clipboard

Fixed the problem of reuploading of files already selected while using c...

Open ashokkumar opened this issue 11 years ago • 6 comments

Fixed the problem of reuploading of files already selected while using click_submit_target is set without reinitialising the S3Uploader.

ashokkumar avatar Aug 13 '13 10:08 ashokkumar

Is it supposed to be spelt fomrs?

kcollignon avatar Aug 13 '13 15:08 kcollignon

Yes, its a typo error. Should be spelled as forms_for_submit

ashokkumar avatar Aug 14 '13 05:08 ashokkumar

'ou' or 'or'? ;)

siliconsenthil avatar Sep 23 '13 07:09 siliconsenthil

@ashokkumar's solution works. Without the fix, it keeps re-uploading files that you've already uploaded in addition to any new files that you've added.

For those who need the fix now, try this is your Gemfile:

gem 's3_direct_upload', github: 'ashokkumar/s3_direct_upload', ref: '06d75a9b433609018a81ad286723497d314ab48d' # S3 upload

chrisdpeters avatar Oct 30 '13 11:10 chrisdpeters

@waynehoover Can you get this change in there so I can stop referencing GitHub in my Gemfile?

chrisdpeters avatar Sep 18 '14 12:09 chrisdpeters

I'm not sure why you are removing the {} replacing.

   key = $uploadForm.data("key")
      .replace('{timestamp}', new Date().getTime())
      .replace('{unique_id}', @files[0].unique_id)
      .replace('{extension}', @files[0].name.split('.').pop())

I find that much easier to read than

key = key_starts_with+new Date().getTime()+"-"+@files[0].unique_id+"-"+Math.random().toString(36).substr(2,16)+"/"+this.context.find('div.filename').html()

Which, by the way whats wrong with @files[0].name.split('.').pop(), this.context.find('div.filename').html() seems more brittle to me.

waynehoover avatar Sep 18 '14 21:09 waynehoover