≈ the.bay.news

Best way to structure file management routes

programming.dev
Best way to structure file management routes
Hello, I have made an upload and download route, both take or return streams of the file content to the browser, however I also want to make a file editor, I have been playing around with the idea of having it so as you scroll more, it fetches more of that file content from the backend, except this currently does not use the multipart stream. I am wondering if it would be better if i had 4 routes, /upload, /download, /getfilecontent, and /patchfilecontent, the last 2 taking or returning json which contains raw text, or if its more standard and proper to just re-use upload and download but add headers so it can take offsets to patch or get file content, note this would require an extra translation step to take from a multipart stream and convert it into text to show in the browser, and some extra steps for the other way around. What would you recommend?

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.