Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7016987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:51:23+00:00 2026-05-27T22:51:23+00:00

I am trying to do some simple file IO using amazon S3 and C#.

  • 0

I am trying to do some simple file IO using amazon S3 and C#.

So far I have been able to create files and list them. I am the bucket owner and I should have full access. In CloudBerry I can create and delete files in the bucket. In my code when I try to delete a file I get an access denied exception.

This is my test method:

[Test]
public void TestThatFilesCanBeCreatedAndDeleted()
{
    const string testFile = "test.txt";

    var awsS3Helper = new AwsS3Helper();

    awsS3Helper.AddFileToBucketRoot(testFile);
    var testList = awsS3Helper.ListItemsInBucketRoot();
    Assert.True(testList.ContainsKey(testFile)); // This test passes
    awsS3Helper.DeleteFileFromBucket(testFile); // Access denied exception here
    testList = awsS3Helper.ListItemsInBucketRoot();
    Assert.False(testList.ContainsKey(testFile)); 

}

My method to add a file:

var request = new PutObjectRequest();
        request.WithBucketName(bucketName);
        request.WithKey(fileName);
        request.WithContentBody("");
        S3Response response = client.PutObject(request);
        response.Dispose();

My method to delete a file:

var request = new DeleteObjectRequest()
        {
            BucketName = bucketName,
            Key = fileKey
        };
        S3Response response = client.DeleteObject(request);
        response.Dispose();

After running the code the file is visible in CloudBerry and I can delete it from there.

I have very little experience with Amazon S3 so I don’t know what could be going wrong. Should I be putting some kind of permissions on to any files I create or upload? Why would I be able to delete a file while I am logged in to CloudBerry with the same credentials provided to my program?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:51:24+00:00Added an answer on May 27, 2026 at 10:51 pm

    I’m not sure what is the source of problem. Possibly security rules, but maybe something very simple with your bucket configuration. You can check them using S3 Organizer Firefox plugin, using AWS management site or any other management tool. Also I recommend request-responce logging – that helped a lot in different investigating for me. AWSSDK has plenty of good exmamples with logging – so you need only copy-paste them and everything works. If you have actual requests sending to Amazon, you can compare them with documentation. Please check AccessKeyId for your deleteRequest

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some simple text file. I am trying to read that file contents
I'm trying to create a simple file upload form for my website. I'm using
I'm trying to post some very simple data to a php file using jquery
I was trying to place some simple effects on an image using HBox using
I am trying to create a program that will do some simple calculations, but
i was trying to do some simple text formatting using JEditorPane but then as
I am trying to read a very simple but somehow large(800Mb) csv file using
I am using the simple navigation gem to create some simple navigation for my
I am trying to create a simple configuration file that looks like this url
I am trying to implement a very simple file transfer client in python using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.