Upload File using Akka-HTTP and Binary protocol in Scala through web socket.


Hello All,

In this blog we are using Akka-HTTP and Binary protocol to Upload File .

Binary protocol

A binary protocol is a protocol which is intended or expected to be read by a machine rather than a human being, as opposed to a plain text protocol such as IRC, SMTP, or HTTP.
Binary protocols have the advantage of terseness, which translates into speed of transmission and interpretation.

Binary protocol is also used in the context of a protocol between exactly two parties, in contrast to a multi-party protocol.Binary protocol, or binary collaboration have been used in the terminology of standards such as EbXML and EDOC.[1] An interface in UML [2] may also be considered a binary protocol.

With the help of binary protocol and Akka-HTTP we developed a mini project which can upload file.

  1. To upload file using binary protocol we are using DWST(Dark WebSocket Terminal) .
  2.  Server is running on  localhost:3000 .

You can find complete code Here

Connect with server using DWST command  /connect ws://localhost:3000/upload

first

Hit /loadbin command on DWST to upload file this will open you picture folder.

loadbin

Select an image which you want to Upload .

second

After seletcting file you will get a message,  Binary file loaded to “default”

third

Now you file is loaded at default location of DWST . Now hit /binary [bin] to upload file on server .

fourth

Now your file is uploaded on the server at /tmp directory.

Resources

Binary protocol

Thanks !!!


KNOLDUS-advt-sticker

This entry was posted in Scala. Bookmark the permalink.

One Response to Upload File using Akka-HTTP and Binary protocol in Scala through web socket.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s