-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MOVE on chunked upload #31973
Comments
GitMate.io thinks the contributor most likely able to help you is @PVince81. Possibly related issues are #11106 (Parallel upload of chunks), #15647 (Work directly on storage in chunk upload mode), #16278 (Problems with Chunked upload), #8955 (Web Based File Upload Chunking), and #17066 (Upload movie fail : chunking loop). |
It depends if you are doing the "old" or "new" chunking. Sounds like "new" chunking. Have a look in: https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdav/webdav-related-new-endpoint.feature |
see here: core/apps/dav/bin/chunkperf.php Line 74 in fe5aef8
|
Thanks for the response! I am using the new chunking method. I have looked over the linked resource, and I think I see what is going on (I am not a PHP dev, so some of the syntax is a little new for me). I still can't quite locate where my code is going wrong however... I will share the two major places that are executing the calls: // Config object:
const config = {
headers: {
'Access-Control-Allow-Origin': 'https://localhost:8080',
'Content-Type': 'application/x-www-form-urlencoded'
},
auth: fileObj.ocCredentials,
onUploadProgress: progressEvent => {
fileObj.setMultipartProgress(
progressEvent,
totalParts,
currentPart
);
}
// uploadUrl is
// `http://myowncloudinstance/owncloud/remote.php/dav/uploads/${username}/${uploadId}`
// Folder was first created on the backend with a MKCOL to the above endpoint, url was returned to client.
this.http
.put(part.uploadUrl, part.data, part.config)
.then(response => {
this.$emit("chunkUploaded", part.fileObj, part.currentPart);
this.processQueue(queue, fileObj, response);
}) Second part that deals with the move itself looks like this: return this.http({
url: fileObj.chunkedUploadUrl,
method: 'MOVE',
auth: fileObj.ocCredentials,
headers: {
'Access-Control-Allow-Origin': 'https://localhost:8080',
'Destination': fileObj.path
}
})
// destination is:
// http://myowncloudinstance/owncloud/remote.php/dav/files/admin/SMB/tpsxrepos/file/path
.then(moveResponse => {
this.$emit("fileUploaded", {
file: fileObj,
response: response.data
});
this.setUploading(false);
return true;
}) All of these steps work now without errors. However, when the uploads file/folder is moved, it doesn't assemble the pieces. It looks to me like I am doing all the steps, but maybe I am missing . crucial header to the process or using a wrong destination path? Thanks again for the help. I would be happy to contribute back after this with some documentation for these endpoints based on what I have learned as an independent developer of a customer client. |
In
That finds its way through to the URL for the MOVE. |
omg! It worked! Thank you again so much. I will put together some documentation for getting chunked upload working with the API for anyone else like me that might have to interact with it. The /.file part wasn't documented anywhere, so thank you for pointing that out to me. You guys rock. |
Hmmm - acceptance tests are the new "documentation" ;) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I posted an issue yesterday trying to solve an issue I was having with chunked upload. I hit another seeming wall with the process. As there is not much documentation for this process, i thought I would ask again, and perhaps @DeepDiver1975 might be able to help.
Currently, I am now uplloading each chunk to the endpoint /owncloud/remote.php/dav/uploads/admin/:uploadid/:chunknumber. I increment the chunk number for each new chunk. I wind up with a file with a bunch of numbered files in it.
Once all chunks are completed, I then call a MOVE command on /owncloud/remote.php/dav/uploads/admin/:uploadid with the location to move the file to. The file moved successfully, but it is just the same folder with all the numbered files in it. The chunks were not assembled on the move.
What am I doing wrong? I have scoured the internet to find info on this without much luck,
Thanks in advance!
The text was updated successfully, but these errors were encountered: