Upload an Excel spreadsheet file for later processing.
Supported formats:
- Excel (.xlsx)
Maximum file size: 100 MB
Upload a file
package main
import (
"bytes"
"context"
"fmt"
"io"
"github.com/deeptable-com/deeptable-go"
"github.com/deeptable-com/deeptable-go/option"
)
func main() {
client := deeptable.NewClient(
option.WithAPIKey("My API Key"),
)
file, err := client.Files.Upload(context.TODO(), deeptable.FileUploadParams{
File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", file.ID)
}
{
"id": "file_01kfxgjd94fn9stqm414vjb0s8",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"created_at": "2024-01-15T10:30:00Z",
"file_name": "financial_report.xlsx",
"object": "file",
"size": 1048576
}Returns Examples
{
"id": "file_01kfxgjd94fn9stqm414vjb0s8",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"created_at": "2024-01-15T10:30:00Z",
"file_name": "financial_report.xlsx",
"object": "file",
"size": 1048576
}