Fb/s3 temp copy support - #1
Conversation
2048481 to
e6c06b7
Compare
| # dock never accepts more than the final record would validate anyway. | ||
| def authenticated_s3_post(temp_key, options = {}) | ||
| max_size = options[:max_size] || attachment_options[:temp_max_size] || attachment_options[:max_size] | ||
|
|
There was a problem hiding this comment.
do we need to check content type?
There was a problem hiding this comment.
do our gem need to handle those?
There was a problem hiding this comment.
content-type handling done on model level
| # logged and left for the bucket's lifecycle rule to clean up instead. | ||
| def save_from_temp_key!(temp_key, options = {}) | ||
| was_new_record = new_record? # only destroy a row we just created, never a pre-existing one | ||
| old_full_filename = File.join(attachment_options[:temp_path_prefix], temp_key) |
There was a problem hiding this comment.
do we have restriction in simplifyem server, to always have temp key starting with user_xx_entity_xxx
| @old_filename = nil | ||
| save! | ||
|
|
||
| copy_file(old_full_filename, full_filename, temp_bucket) |
There was a problem hiding this comment.
it will destroy the record and throw error
| # temp_path_prefix/temp_expires_in defaults live in S3Backend.included instead (the only | ||
| # backend that reads them) -- setting them here, before that runs, would permanently | ||
| # shadow any amazon_s3.yml-level default with this literal. | ||
| options[:content_type] = [options[:content_type]].flatten.collect! { |t| t == :image ? ::Technoweenie::AttachmentFu.content_types : t }.flatten unless options[:content_type].nil? |
There was a problem hiding this comment.
can u check on thumbnail too? how master works and how forked version works?
There was a problem hiding this comment.
fixed thumbnail generation issue
| # filename, the file it replaces) is best-effort: a failure there doesn't roll back an | ||
| # already-successful adoption (record saved, file at its permanent key) -- it's | ||
| # logged and left for the bucket's lifecycle rule to clean up instead. | ||
| def save_from_temp_key!(temp_key, options = {}) |
There was a problem hiding this comment.
Check what happens when the file is deleted because it was classified as malicious. It should handle it gracefully and log it properly when the temp key not found
There was a problem hiding this comment.
fixed
No description provided.