Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To change the filename using Onfileselected() callbacks in ROR #223

Open
boo68120 opened this issue Oct 11, 2019 · 0 comments
Open

How To change the filename using Onfileselected() callbacks in ROR #223

boo68120 opened this issue Oct 11, 2019 · 0 comments

Comments

@boo68120
Copy link

We need to change the filename becoz of the S3 Url encode and filestack url encode is different so the image not opening...Thanks in advance..

filepicker.pickAndStore {
mimetypes: ['image/', 'application/'],
services: ['COMPUTER'],
multiple: true
}, { location: 'S3', path: uploadPath, storeContainer: s3Bucket, access: 'public' }, (s3Blobs) ->
originalPhoto = {}
s3Blobs.forEach (s3Blob, index) ->
originalPhoto[s3Blob.filename] = s3Blob
if s3Blob.mimetype.match(/^image/*/g)
filepicker.convert s3Blob, { width: 32, height: 32 },
{ location: 'S3', path: uploadPath, container: s3Bucket, access: 'public' }, (thumbBlob) ->
EventAttachment.attrs.attachment_type_id = 1 # For image attachment type
attachmentParams = {
attachment:
key: "#{s3Url}/#{originalPhoto[thumbBlob.filename].key}"
name: "#{s3Url}/#{thumbBlob.key}"
}
EventAttachment.save(attachmentParams, galleryId)

@boo68120 boo68120 changed the title How To change the filename using PickAndStore Using Ruby js Coffeee How To change the filename using Onfileselected() callbacks in ROR Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant