How can I get an S3 asset's remote path minus the bucket name from within my plugin? My plugin takes as an argument the id of an asset. So I'm starting from here:

   $entry = craft()-&gt;elements-&gt;getElementById($entry_id); 


Assuming my asset has the url http://mybucket.mycompany.com/uploads/pdfs/myfile.pdf, how can I return just 'uploads/pdfs/myfile.pdf' from within my plugin?
I'd just use the replace filter to chop it off...


  https://craftcms.com/docs/templating/filters#replace


Even if you didn't know the bucket name exactly, replace supports regex.