so I'm sending a post request to http://localhost:3000/++api++/folder/@tus-upload/ from the frontend, but it returns a 404 not found error with the following response
{
"message": "Resource not found: http://localhost:3000/folder",
"type": "NotFound"
}
Because of this issue, I changed the route to http://localhost:3000/++api++/@tus-upload/ which returns a 201 created response.
We get the location id from the previous response header and send a patch request to http://localhost:3000/@tus-upload/941fdbbd9b5e467ca5adfce36e2517fc which returns a 404 not found error.
You should be using a js client which handles this all for you. The TUS endpoint impliments the TUS standard so GitHub - tus/tus-js-client: A pure JavaScript client for the tus resumable upload protocol should work just fine.
The problem with the folder is being missing is likely because the folder is missing. Where are you getting the url of the context of where you intend to upload to?
I'm making the request using the @rpldy/tus-uploady library.
This is from the code you had sent me.
The issue seems to be with the folder then, the contentsuploadModal gets a prop called uploadURL, which I set to '/folder' as it was given in docs.
The below line was creating the final url. const uploadURL = '/++api++/' + this.props.uploadURL + '@tus-upload';
then the url would look something like http:localhost:3000/++api++/folder/@tus-upload
Is the folder thing something important in volto, like a content-type or something?
what's the idea here, do we first create a folder then use that folder name while making a tus-upload?
it would be great if you could point me to some docs for it.
Just for completeness, as mentioned privately... there was a part of our code missing in what we had given you... there needed to be changes to middleware to allow these kids of requests to pass through. And in addition, being a restapi the folder named "folder" did have to actually exist.