S3 Delete

Archived from the Transloadit support forum. Originally posted on October 29, 2012; details may be outdated, see our docs for current behavior. Original thread

Hi,

Is there a s3/delete robot ? If not, do you have plans to do one ?

I’m having difficulties with deleting my file from S3 (in my Rails app) - “SignatureDoesNotMatch” error. No doubt it has everything to do with (the lack of) the Policy document and StringToSign.

Any help on this subject would be much appreciated. Thanks.

Hey Rick,

unfortunately we do not have an /s3/delete robot yet. We only specialize in the encoding and processing of files and the required things to get files into our system (sftp/import, http/import and uploading).

We have no plans to support a bigger set of the S3 API in the near future. I am sorry about that.

kind regards,
Tim

Co-Founder Transloadit
@tim_kos

No worries Tim. Thanks for the prompt response. I’ll keep searching for a solution !

Happy to close this question if no one else has any suggestions or comments. Thanks.

For anyone interested, here’s the code.

class Image < ActiveRecord::Base

  belongs_to :article
  attr_accessible :file_type, :link, :title


  def destroy
      s3 = AWS::S3.new(:access_key_id => AWS_KEY, :secret_access_key => AWS_SECRET)
      bucket = s3.buckets[AWS_BUCKET]
      s3_link = self.link
      bucket.objects[s3_link].delete    
      super()
  end
end

Here self.link refers to the S3 object key. I’m trying to work out where and how to implement the Policy and StringToSign code.

Hey rick,

thanks for sharing the code. I am closing this ticket now. The ticket and the code can still be found using the search functionality.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos