s3_direct_upload
s3_direct_upload copied to clipboard
Fixed the problem of reuploading of files already selected while using c...
Fixed the problem of reuploading of files already selected while using click_submit_target is set without reinitialising the S3Uploader.
Is it supposed to be spelt fomrs?
Yes, its a typo error. Should be spelled as forms_for_submit
'ou' or 'or'? ;)
@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
@waynehoover Can you get this change in there so I can stop referencing GitHub in my Gemfile
?
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.