I want to develop a REST server file manager with resume capability using .Net Core WebApi. Currently I have:
GET api/FileManager/path/to/directory: returns JSON with the content of the directory (subdirectories and files)
GET api/FileManager/path/to/file.txt: download the file with resume capability (e.g. Range: Bytes=0-1023)
HEAD api/FileManager/path/to/file/or/directory: returns empty 200 if the file or directory exists, if not returns empty 404
PUT api/FileManager/path/to/file.txt (with the file content in the body): upload a file
DELETE: delete a file or directory if it exists
Now I am struggling with other functions such as rename or compress My questions:
- How can I implement "rename" (which includes the Move case) a file or directory function with REST? Is it PUT or PATCH? I am thinking that the input would have to contain the new full name of the file/directory
- How can I implement "compress"? The client will send a JSON body containing the files and directories to be added to the ZIP file. None of the VERBS sounds suitable, for example, if I use POST, will not be able to differentiate with the file upload
- Am I missing anything in implementing file download with resume? I heard about bytes=0-0,-1 but have no idea about it.