Posting to Space (In Unity or Java)

Hey folks,

Been fighting with this for a while and tempted to give up with spaces. I am trying to post a file into my space from either my Unity application (preferable) or from my server directly which is running on Java.

The AWS SDK is broken for Unity, which is why I turned to Digital Ocean in the first place, and now finding it pretty disheartening to see AWS SDK’s being used as the answer for posting to spaces.

Anyway, I am seem to be closest in posting from the server, since I managed to post to S3 from it, but its just giving me horrible unhelpful errors of ‘Invalid Argument’. Well that is great, which one is invalid :P

This is the code I am currently using:

awsS3credentials = new AWSStaticCredentialsProvider(new BasicAWSCredentials(Settings.S3AccessKey, Settings.S3SecretKey));

awsS3client = AmazonS3ClientBuilder.standard()
                        .withEndpointConfiguration(new EndpointConfiguration("", "nyc3"))

PutObjectRequest put = new PutObjectRequest(Settings.BucketName, fileName, new ByteArrayInputStream(data), metadata);


I have ensured that my bucket name is my spaces name and that the keys are the correct ones from DO. Any ideas?

The code is basically taken from this thread: Link but my error is different.


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

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.

This comment has been deleted

Hi, did anyone resolve the above issue?

I am facing the same problem, Did anyone resolve this or Digital Ocean is not sure about the solution?