Support zip download/upload API #271

Closed
davidebbo opened this Issue Dec 20, 2012 · 13 comments

Comments

Projects
None yet
7 participants
Owner

davidebbo commented Dec 20, 2012

To complement the vfs API, it would be nice to have a 'batch' API that works with zip files. e.g.

  • GET /zip/foo/bar would zip up /foo/bar folder and download it
  • PUT /zip/foo/bar would unzip onto that folder

This would make it much easier to retrieve a bunch of files from a site, or to upload a whole folder (like in USE_PRIVATE_KUDU scenario).

Owner

suwatch commented Dec 20, 2012

Could we just use Content-Encoding as directive? Using /zip canonical as directive might disallow people with the folder name /zip.

Owner

davidebbo commented Dec 20, 2012

/zip is just the name of the new API, like /vfs, deployments, etc... It can't conflict with any user files.

Owner

suwatch commented Dec 20, 2012

Got it. In that case, would you need a /zipscm counter part? I still think we could do away with standard http dialect Content-Encoding.

Contributor

pranavkm commented Dec 20, 2012

Can we use Accept-Encoding / Content-Type to do this with the vfs API instead?

Owner

davidebbo commented Dec 20, 2012

Reusing the Scm API feels quirky and ambiguous to me. e.g. you may want to actually upload a straight zip file, and you would be entitled to set the content type to zip. So my vote is separate API.

Contributor

HenrikFrystykNielsen commented Dec 20, 2012

Yup, I agree.

Member

amitapl commented Dec 21, 2012

Also it's nicer when you can easily do it from a browser.

Owner

davidebbo commented Dec 21, 2012

Indeed, that's true for the GET side. Basically like our current Dump API, but more generalized.

Owner

suwatch commented Dec 21, 2012

So this is a special case and only apply to folder such as GET/PUT whole folder (with files) in zip format. This does not apply to PUT/GET individual file.

Owner

davidebbo commented Jan 5, 2013

The semantic when uploading a zip file is interesting, as there are two possible behaviors:

  1. Unzip everything from the zip file into the target folder, leaving everything else unchanged (though some specific files may get overwritten).
  2. Completely replace the contents of the target folder with what's in the zip file. When uploading a new version of private Kudu, this is the more correct behavior.

One option is to use PATCH for (1) and PUT for (2). That seems to match the intended verb semantic.

Contributor

HenrikFrystykNielsen commented Jan 5, 2013

FWIW, I like the idea of making it “just like HTML file upload” meaning that it should be an HTML file upload form POST. Web API already has great support for dealing with HTML file upload.

That also makes it possible to have additional form post parameters indicating whether existing files should be overridden, what the destination folder should be, etc.

davidebbo was assigned Jan 7, 2013

davidebbo closed this in 66d1a51 Feb 11, 2013

maggieying was assigned Mar 1, 2013

Contributor

dravva commented Mar 1, 2013

Assigning to Maggie for verification.

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