dolthub / dolthub/dolthub-issues

File upload API fails with `{"error":"must supply a content_length"}` for what seems like a valid request according to the documentation

Open
#573 1 comment 0 reactions 1 assignee Claimed by @liuliu-dev View on GitHub
bug
Dominant language
No language data
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
$ curl -L \
--request POST \
--url 'https://www.dolthub.com/api/v1alpha1/timsehn/file_upload_api/upload' \
--header 'authorization: dhat.v1.i61she5ittqbhvnf5pdcrsrpegmqetm3qklp360gkjq2a5urp4t0' \
--header 'Content-Type: multipart/form-data' \
--form 'file=text' \
--form 'params={"tableName": "t", "fileName": "/Users/timsehn/dolthub/dolt/file_upload_api/file.csv", "branchName": "", "fileType": "Csv", "importOp": "Create"}'
{"error":"must supply a content_length"}
```

I think @coffeegoddd changed the API to make giant file uploads work on DoltHub but we did not update the documentation for the new API:

https://docs.dolthub.com/products/dolthub/api/database

Plus, having to know the `content_length` and `num_parts` is not a great interface for a public facing API. I suspect we want to keep the old file size limit on the public API. But I could be convinced otherwise

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.