• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
tus.io – Resumable file uploads for web and mobile apps by Felix Geisendörfer
 

tus.io – Resumable file uploads for web and mobile apps by Felix Geisendörfer

on

  • 1,619 views

File uploading is an incredibly annoying, yet very important feature to get right for your applications. Unfortunately time is usually short, so most applications handle network errors during file ...

File uploading is an incredibly annoying, yet very important feature to get right for your applications. Unfortunately time is usually short, so most applications handle network errors during file uploads very poorly. For this reason we have started tus.io, which aims to define an open protocol for resumable file uploads along with providing implementations for all plattforms and languages. This session will introduce you to the project, and show you how to add better file uploading to your web and mobile apps.

Statistics

Views

Total Views
1,619
Views on SlideShare
1,595
Embed Views
24

Actions

Likes
1
Downloads
12
Comments
0

3 Embeds 24

http://berlin.codemotionworld.com 22
http://callforpaper.codemotionworld.com 1
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    tus.io – Resumable file uploads for web and mobile apps by Felix Geisendörfer tus.io – Resumable file uploads for web and mobile apps by Felix Geisendörfer Presentation Transcript

    • felixgetus.ioResumable file uploads for web and mobile appsFelix Geisendörfer?
    • felixgeAbout Me
    • felixgeI Open Source
    • felixge
    • felixge
    • @felixgefelixge
    • @felixgefelixgeNodecopter.com
    • felixgeImplemented fileupload?
    • felixgeThe Case ForResumable FileUploads
    • felixgeContent is king
    • @felixgefelixgeUser Generated Content
    • felixgeIf content is king, youshould care aboutacquiring it
    • felixgeGetting harder
    • @felixgefelixgeHD cameras everywhereHDCamerasHugefile sizesExample: 45 second video on iPhone 5 = ~100 MB
    • @felixgefelixgeSlow uplinks• Wifi: ~2.5min (~5000kbsp)• LTE: ~10 min (~1300 kbsp)• 3G: ~40min(at ~330 kbps)• Edge: ~68 min (at 200 kbps)Average upload speeds for 100 MB** sources: Apple Network Link Conditioner and http://www.lte-anbieter.info/presse/12/analyse-speed-lte.html
    • @felixgefelixgeUnreliable Networks
    • felixge99.9 / 100 MB upload, 2 seconds remainingerror: connection lost, please upload again!
    • felixgeresumable file uploading
    • felixgepossible today,but way too hard
    • felixgeHTML Uploads
    • @felixgefelixgeForm-based File Upload in HTML1 <form2 action="/"3 method="post"4 enctype="multipart/form-data"5 >6 <input name="upload" type="file" accept="image/*">7 <input type="submit" value="Upload File">8 </form>RFC1867 - Nov 25, 1995
    • @felixgefelixgemultipart/form-dataPOST / HTTP/1.1Host: localhost:8080Content-Type: multipart/form-data;boundary=---------------------------1735847702826983019589436949Content-Length: 2936447-----------------------------1735847702826983019589436949Content-Disposition: form-data; name="upload"; filename="gopher.png"Content-Type: image/pngPNGIHDR�7/iCCPICC Profilec``2ptqre``�+)rwR�R`��� ``��yy |��<more data>-----------------------------32473823211195181971638105612--
    • @felixgefelixgeMissing Features• Progress indication• Background Uploads• Selecting multiple files• File size limits• Drag & Drop• etc.
    • felixge
    • @felixgefelixge
    • @felixgefelixgeHTML5• File API + XMLHttpRequest2• Background Uploads, Drag & Drop, Reading file data in JS, SelectingMultiple Files, Upload Progress, etc.• Available in Chrome, Firefox, Safari, Opera, IE 10
    • felixgeHow to resume ahttp upload*?* ideally in a RESTful way
    • felixgenot defined : /
    • felixge<rant>rfc2616 is a bad place to look for wisdom
    • @felixgefelixgeGET / HTTP/1.1Host: foo.example.comAccept: text/plain;q=0.1,text/*;q=1,*/*;q=0Range: bytes=8-
    • @felixgefelixgeGET / HTTP / 1 . 1Accept: text/plain ; q = 0.1,,,,,,,,, ,,,,,, ,,,,,,,,,,,,,,,,,text/* ; q =1 . 00Range: bytes =8-Host:foo.example.comAccept: , */* ; q = 0 ,
    • felixge</rant>
    • felixgePrior Art
    • @felixgefelixgeYouTube API v2.0 – Resumable Uploads• Based on Google Gears protocol• Invents new http code 308 Resume Incomplete• Uses PUT to “query” upload status• Abuses “Content-Range”, “Range” headers• Not meant for interoperability
    • @felixgefelixgeAmazon S3• Multipart API• Complicated, hard to implement for clients, hard for servers• 5 MB chunk size limit• REST? What’s REST?• Not meant for interoperability
    • @felixgefelixgeresumable.js• Uses multipart/form-data, not RESTful• Requires lots of small chunk requests (ovhead)• Poorly specified protocol• Still: Probably best open source solution out there right now
    • felixgethe tus resumableupload protocol
    • felixgesimple, open, freehttps://github.com/tus/tus-resumable-upload-protocolv0.2.1 released 3 days go
    • felixgePOST /files HTTP/1.1Host: tus.example.orgContent-Length: 0Final-Length: 100HTTP/1.1 201 CreatedLocation: http://tus.example.org/files/1
    • @felixgefelixgePATCH /files/1 HTTP/1.1Host: tus.example.orgContent-Length: 100Offset: 0[file data]HTTP/1.1 200 Ok
    • @felixgefelixgeHEAD /files/1 HTTP/1.1Host: tus.example.orgHTTP/1.1 200 OkOffset: 70
    • @felixgefelixgePATCH /files/1 HTTP/1.1Host: tus.example.orgContent-Length: 30Offset: 70[remaining file data]HTTP/1.1 200 Ok
    • felixgeclients and serversfor all platforms
    • @felixgefelixgeclients and servers• tusd - reference server, implemented in Go• brewtus - node.js server implemented by Naren Venkataraman• tus-jquery-client, JS client using jQuery• tus-ios-client, native objective C client library• tuspy, python client by Naren Venkataramanhttp://www.tus.io/implementations.html
    • felixgeupload acceleration
    • felixgechecksums, metadata, streams, etc.
    • felixgedemo
    • @felixgefelixgeFuture• Release v1.0 of protocol• Submit as RFC• Adoption by all majors frameworks, libraries and products
    • @felixgefelixge
    • felixge
    • @felixgefelixgetus.io
    • felixgeQuestions?