Skip to content
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

[ocis][clients] Large File Uploads #19

Closed
11 of 12 tasks
micbar opened this issue Apr 6, 2020 · 5 comments
Closed
11 of 12 tasks

[ocis][clients] Large File Uploads #19

micbar opened this issue Apr 6, 2020 · 5 comments

Comments

@micbar
Copy link
Contributor

micbar commented Apr 6, 2020

Future

Use Cases

  • Large File Uploads
  • Instable connections
  • middlewares are interfering

Nasty middleware example:
PUT > 100MB will fail:
https://demo.shniq.cloud/
Cloudflare limits upload size (HTTP POST request size) per plan type:
100MB Free and Pro
(Source: https://support.cloudflare.com/hc/en-us/articles/200172516#h_51422705-42d0-450d-8eb1-5321dcadb5bc)

Cern

  • Needs to be decided it CERN and Clients will stick to Chunking V1 and go directly to Tus (V3)

oCIS

Reva changes

Phoenix

Start next sprint with TUS client https://github.com/owncloud/enterprise/issues/3901

Effort: M
Complexity: S/M

Desktop

  • Start with TUS for 2.8

iOS

  • TUS implementaition will start as soon as Phoenix POC is tested

Android...

@micbar
Copy link
Contributor Author

micbar commented Apr 6, 2020

@PVince81
Copy link

We might want to clarify that the scope of this only applies to authenticated uploads, not public link nor file drop. In OC 10 we decided against chunking for anonymous access due to the possibility of spamming the upload cache with random chunks by unauthenticated users.

@PVince81
Copy link

PVince81 commented Apr 27, 2020

Some tech info about the curl requests for a simple "two-request" based upload which can be useful for clients:

  1. Curl for initiating an upload:
curl -D - 'https://localhost:9200/remote.php/dav/files/einstein/' \
  -X 'POST' \
  -u einstein:relativity \
  -H 'Tus-Resumable: 1.0.0' \
  -H 'Upload-Length: 10000' \
  -H 'Upload-Metadata: filename bG1tcy0xLjIuMC1yYzgtbGludXgteDg2XzY0LkFwcEltYWdl,filetype YXBwbGljYXRpb24vdm5kLmFwcGltYWdl,size OTgxNjg1MjA=,mtime MTU1MjIzOTI1MC4wNDg=' \
  --insecure
HTTP/1.1 201 Created
Access-Control-Allow-Headers: Tus-Resumable, Upload-Length, Upload-Metadata, If-Match
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Tus-Resumable, Location
Content-Length: 0
Date: Mon, 27 Apr 2020 13:52:17 GMT
Location: http://localhost:9164/data/3b0ba66e-4745-437e-9410-6d9a7ee06eee
Tus-Resumable: 1.0.0
Vary: Origin
X-Access-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNTg3OTk5MTM3LCJpYXQiOjE1ODc5OTU1MzcsImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJ1c2VyIjp7ImlkIjp7ImlkcCI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJvcGFxdWVfaWQiOiJlaW5zdGVpbiJ9LCJ1c2VybmFtZSI6ImVpbnN0ZWluIiwibWFpbCI6ImVpbnN0ZWluQGV4YW1wbGUub3JnIiwiZGlzcGxheV9uYW1lIjoiRWluc3RlaW4ifX0.etJPHNQHXOJnZY88b3ZL7HZ55_PhXvKBA6Lm2tjS-LY

=> you can replace username/password with an authorization + bearer token instead

  1. Then send the data there to the location got in the "Location" header:
curl -D - -k 'http://localhost:9164/data/3b0ba66e-4745-437e-9410-6d9a7ee06eee' \
  -X 'PATCH' \
  -u einstein:relativity \
  -H 'Connection: keep-alive' \
  -H 'Tus-Resumable: 1.0.0' \
  -H 'Upload-Offset: 0' \
  -H 'Content-Type: application/offset+octet-stream' \
  -d "abcdefghijklmno"  
HTTP/1.1 204 No Content
Tus-Resumable: 1.0.0
Upload-Offset: 15
X-Access-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNTg3OTk5NjIxLCJpYXQiOjE1ODc5OTYwMjEsImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJ1c2VyIjp7ImlkIjp7ImlkcCI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJvcGFxdWVfaWQiOiJlaW5zdGVpbiJ9LCJ1c2VybmFtZSI6ImVpbnN0ZWluIiwibWFpbCI6ImVpbnN0ZWluQGV4YW1wbGUub3JnIiwiZGlzcGxheV9uYW1lIjoiRWluc3RlaW4ifX0.ES-3q4Cf1tEbF_umOIzzXbLcLujeAHHo4bkUtI6PwAg
X-Content-Type-Options: nosniff
Date: Mon, 27 Apr 2020 14:00:21 GMT

Since we only uploaded a few bytes, the offset moved to 15

Replace "abcdefghijklmno" with the file data. (I didn't manage to and -F uses multipart which mangles the content-type)

@PVince81
Copy link

PVince81 commented May 5, 2020

I've updated the checkboxes and added a few more as I continue finding small issues

TheOneRing added a commit to TheOneRing/client that referenced this issue Jun 17, 2020
TheOneRing added a commit to TheOneRing/client that referenced this issue Jun 17, 2020
TheOneRing added a commit to TheOneRing/client that referenced this issue Jun 22, 2020
TheOneRing added a commit to owncloud/client that referenced this issue Jun 23, 2020
@PVince81
Copy link

PVince81 commented Sep 3, 2020

Matching Jira ticket https://jira.owncloud.com/browse/OCIS-9 was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants