Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different ways to upload a file?

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:

enter image description here

  • 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
like image 459
smwikipedia Avatar asked Jul 06 '15 06:07

smwikipedia


People also ask

What are 2 ways you can upload files to Google Drive?

There are two ways to upload files to Google Drive: Drag-and-drop files. If you're using the latest versions of Chrome or Firefox, you can simply drag-and-drop files directly from your computer into Google Drive. You can even drag-and-drop files directly into folders or sub-folders.

What is the easiest way to upload a document?

On your Android phone or tablet, open the Google Drive app. Tap Upload. Find and tap the files you want to upload. View uploaded files in My Drive until you move them.


1 Answers

Others ways to upload files to server (summarized):

  • FTP: (File Transfer Protocol). It is a standard networking protocol that separates control and data iteration (2 different ports). Because of its insecurity, it can be used SFTP instead (linux systems). https://en.wikipedia.org/wiki/File_Transfer_Protocol

  • SCP: (Secure Copy) which will allow you to transfer files via ssh protocol. https://en.wikipedia.org/wiki/Secure_copy

  • WebDAV, which is an HTTP extension which allows to update content remotely from a client. https://developer.mozilla.org/en-US/docs/Glossary/WebDAV

  • GitHub: which whill allow uploading files using git with a combination of commit/push methods. https://github.com/

  • Rsync: incremental file transfer usually found in Unix-systems. It allows to copy only the changes from the file in the client to the server, saving bandwidth. https://rsync.samba.org/

Finally, the following link shows an implementation method for HTTP upload for Classical ASP: https://support.microsoft.com/en-us/kb/299692

This is a summary of some of the techniques or methods but there are plenty of solutions.

like image 190
juanmajmjr Avatar answered Sep 20 '22 21:09

juanmajmjr