I have read several ways to upload files to server.
HTTP file uploading as
multipart/formdata
(How does HTTP file upload work?)JSON file uploading (How do I upload a file with metadata using a REST web service?)
Is there other options? The project I am working on needs such function. And my file to upload can be as big as several gigabits. I'd like to get a thorough evaluation of different approaches.
ADD 1
Thanks for so many responses. I am occupied for some other things these days and can't get back to this question until I see the SO notifications. I'd like to apologize for adding details so late as the bounty is about to expire.
In my scenario, there're 1 web server
, a file server
and many agents
. The whole picture kind of looks like this:
- User interacts with Web server through browser for routine operations.
- User uploads files to file server through browser. (I want everything happen in browser to make customer life easier.)
- Agent is desktop applications that communicates with web server and file server.
- Agent gets routine information from web server.
- Agent pulls files from and pushes files to file server. And notifies web server about everything.
- Web server pulls files from file server to present it to customer in browser.
And some coding context:
- Java
- Spring
- Netty