Download file content
client.Files.Content.Get(ctx, fileID, query) (*FileContentGetResponse, error)
GET/v5/files/{file_id}/content
Download the raw bytes of a file by id.
Streams the stored object’s content back directly (not a redirect or signed URL), with the response Content-Type set to the file’s stored MIME type and Content-Disposition set to attachment. Use the metadata endpoint for size, filename, and other attributes.
Download file content
package main
import (
"context"
"fmt"
"github.com/scaleapi/sgp-dev-go"
"github.com/scaleapi/sgp-dev-go/option"
)
func main() {
client := sgpdev.NewClient(
option.WithAPIKey("My API Key"),
option.WithAccountID("My Account ID"),
)
content, err := client.Files.Content.Get(
context.TODO(),
"file_id",
sgpdev.FileContentGetParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", content)
}
{}Returns Examples
{}