Question

Using S3.php to handle Space actions, deleteObject fails.

Hello,

Is everyone here using the S3.php to handle Space actions from PHP code?

amazon-s3-php-class

Everything is working so far beside the deleteObejct call, When I try to run it with:

Bucket: bucket-name
URI: bucket/profiles/json-file.json

That doesn’t work, they work if it’s the upload call, I’ve also tried removing the bucket name from the URI, that didn’t work either.

I keep getting this error:

PHP Warning:  S3::deleteObject(): [403] Unexpected HTTP status in /var/www/html/cron/classes/S3.php on line 440

Error 403 is access denied, so maybe it’s the URL that is wrong?

I’ve changed all the space settings, so endpoint is:

public static $endpoint = 'ams3.digitaloceanspaces.com';
public function __construct($accessKey = null, $secretKey = null, $useSSL = false, $endpoint = 'ams3.digitaloceanspaces.com', $region = '')

I hope someone can help as I really need the option to delete an object from my code.

Thanks,

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

solved it, no idea what I did, but I changed a lot and now it works.

This comment has been deleted

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Become a contributor for community

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    DigitalOcean Documentation

    Full documentation for every DigitalOcean product.

    Resources for startups and SMBs

    The Wave has everything you need to know about building a business, from raising funding to marketing your product.

    Get our newsletter

    Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

    New accounts only. By submitting your email you agree to our Privacy Policy

    The developer cloud

    Scale up as you grow — whether you're running one virtual machine or ten thousand.

    Get started for free

    Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

    *This promotional offer applies to new accounts only.