Upload one resumable chunk to a Dataset snapshot
Upload a single chunk of a file as part of a resumable upload into a Dataset read-write snapshot. Call this repeatedly after POST /datasetrw/datasets//snapshot/file/start until all chunks are sent, then finalize with GET /datasetrw/datasets//snapshot/file/end/. Related: POST /datasetrw/datasets//snapshot/file/start (begin upload session; use returned session key as query param key) Related: GET /datasetrw/datasets//snapshot/file/test (check whether a chunk was already uploaded when resuming) Related: GET /datasetrw/datasets//snapshot/file/end/ (move uploaded files into the snapshot)
curl --request POST \
--url https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'file=<string>'import requests
url = "https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file"
payload = { "file": "<string>" }
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({file: '<string>'})
};
fetch('https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "file=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file"
payload := strings.NewReader("file=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("file=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "file=%3Cstring%3E"
response = http.request(request)
puts response.read_body"<string>"{
"message": "Bad Request",
"success": false
}{
"message": "Bad Request",
"success": false
}{
"message": "Bad Request",
"success": false
}Path Parameters
Domino Dataset ID. Obtain from GET /api/datasetrw/v2/datasets or GET /datasetrw/datasets/{datasetId} in the platform API catalog.
Query Parameters
Number of the current chunk
Total number of chunks of the file to upload
Unique identifier for the file to upload
Upload session key returned by POST /datasetrw/datasets/{datasetId}/snapshot/file/start. Must match the session for every chunk in the same file upload.
Path of the file to upload relative to the root directory being uploaded if applicable, or the file name
Size in bytes of one standard (not last) upload chunk
Size in bytes of the current upload chunk
Checksum of the file to upload
Body
File to upload
Response
Upload session key (same as query param key)
The response is of type string.
Was this page helpful?
curl --request POST \
--url https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'file=<string>'import requests
url = "https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file"
payload = { "file": "<string>" }
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({file: '<string>'})
};
fetch('https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "file=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file"
payload := strings.NewReader("file=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("file=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/webvfs/datasetrw/datasets/{datasetId}/snapshot/file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "file=%3Cstring%3E"
response = http.request(request)
puts response.read_body"<string>"{
"message": "Bad Request",
"success": false
}{
"message": "Bad Request",
"success": false
}{
"message": "Bad Request",
"success": false
}