Upload data to DO Spaces using a TCP connection

Posted March 26, 2019 2.2k views

I was hoping to find out there was any way to upload data to DigitalOcean Spaces using a TCP connection. I am currently getting a 302 Found error when I attempt to connect to my Spaces using a TCP connection.

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.

Submit an Answer
3 answers


TCP traffic should be fine. The 302 code is a redirect. I suspect you may be connecting over http rather than https. Make sure the URL you’re connecting to is https. If that is the case and you’re still seeing this, let us know the full error you’re getting from your application, as well as more information about what you are using to connect, and we may have more insight.


Thank you. We are using https. We have been able to connect using TCP but we get the 302 code error when we try to upload a data file. Should we still be using the AWS3 protocols when attempting to upload data using TCP? Is there a way to check data logs for Spaces? Perhaps those logs have some additional details on what we are doing wrong.

  • The 302 code isn’t so much an error but is actually an http redirect. It’s interesting that you’re seeing this with the https call. We are mostly compatible with S3 protocol, but not fully 1:1 compatible (just mostly). You can read more about that here:

    I tried to look up some information on espressif but didn’t get far as to how that correlates. If you can provide more about the function/call or the full underlying request being made to our API from it, that may open up more insight.

    • When we run the following code through Postman

      PUT /example2.txt HTTP/1.1
      Content-Type: text/plain
      Host: SPACES
      Content-Length: 4
      X-Amz-Content-Sha256: 532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25
      X-Amz-Date: 20190326T160421Z
      Authorization: AWS4-HMAC-SHA256 Credential=QS72ZMDN3AHYNA4KU2SP/20190326/sfo2/s3/aws4_request, SignedHeaders=cache-control;content-length;content-type;host;postman-token;x-amz-content-sha256;x-amz-date, Signature=6eb179f72d36fda73f812009d5868b25e4dfa884c57ffb86f04ba29afa148edf
      cache-control: no-cache
      Postman-Token: 4d1eb481-dcc1-4879-9a46-e02015867577

      We get the following error back after 2 minutes or so when we use the following http request:

      AT< +IPD,0,276:HTTP/1.1 403 Forbidden
      AT< Content-Length: 188
      AT< x-amz-request-id: tx000000000000072d65f26-005c9a4e0c-795ea-sfo2a
      AT< Accept-Ranges: bytes
      AT< Content-Type: application/xml
      AT< Date: Tue, 26 Mar 2019 16:06:36 GMT
      AT< Strict-Transport-Security: max-age=15552000; includeSubDomains; preload

      • Interesting. I assume the SPACES_ID is a replacement for privacy, given the public space. It might be a good idea to run this by our support team so that they can pass back to you their findings from logs on our side, just to make sure this is covered. Of course, anyone else in our community is welcome to weigh in if they’ve dealt with this, but I’d love for you to get the answer.

        You can open a ticket with our team here:

        They are a bit backed up right now, but working to handle the tickets as quickly as possible.

In case it is helpful, we are trying to upload data files using Espressif