I am trying to upload large file via sabre ftp client. I was following the documentation Chunked file upload — Nextcloud latest Developer Manual latest documentation
Now I am getting this error
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
<s:message>Incompatible node types</s:message>
</d:error>
The code that generates this error is
$sourcePath = $tempFolder . '/.file';
$destinationPath = $baseUri . $uploadedFolderName . $uploadedFileName;
var_dump($destinationPath);
// "/remote.php/dav/files/wedos-auth-7518fe8d-0f5f-4c87-99a2-xxx/uploaded/deprese.pdf"
var_dump($sourcePath);
// "/remote.php/dav/uploads/wedos-auth-7518fe8d-0f5f-4c87-99a2-xxx/chunks_674d6d3f46a9f/.file"
// Send the MOVE request
$response = $client->request('MOVE', $tempFolder, null, [
'Destination' => $destinationPath,
'OC-Total-Length' => $fileSize
]);
someone can help to make it work?
For the final step of a chunked upload, you need to send a MOVE request from the pseudo-file:
<server>/remote.php/dav/uploads/<user>/<folder>/.file
to the destination file:
<server>/remote.php/dav/files/<user>/<folder>/<file>
So, in your case, the correct way to do the request is:
$sourcePath = $tempFolder . '/.file';
$destinationPath = $baseUri . $uploadedFolderName . $uploadedFileName;
$response = $client->request('MOVE', $sourcePath, null, [
'Destination' => $destinationPath,
'OC-Total-Length' => $fileSize
]);