Ruby on Rails Wednesday, March 11, 2015

Hi!

I'm doing the following:

The user, through my app, is uploading his digital certificate to the S3 using Fog + Paperclip.

Until here I have no doubt in my process.

My problem begins when I need to use this certificate into the Rails. I found two ways of doing:

1. Using the paperclip's method #copy_to_local_file, saving it in a temporary file.

2. Directly using Fog connection.

I thought both methods confused and I suspect there is a simpler way, because it seems an ordinary operation.

My question is: Is there a way of Paperclip give me this certificate like a File class instance without saving in temporary file?) sem eu ter que salvar na máquina local?

I'd like something like this:

person = Person.first
file = person.certificate.to_file # It would be great if this method exists!!!
OpenSSL::PKCS12.new(file, certificate_password)

PS 1: the certificates are privates in S3. So, any suggestion using certificate.url is invalid, because the file wouldn't be accessible.

Ps 2: I don't know if my workflow is right.

Thank you

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9d0fcc02-4af8-4114-9473-a1e56603180e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment