Upload File using Akka-HTTP and Binary protocol in Scala

Table of contents
Reading Time: 2 minutes

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

Binary protocol

This 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.
This protocols have the advantage of terseness, which translates into speed of transmission and interpretation.

This 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 this protocol and Akka-HTTP we developed a mini project which can upload file.

  1. To upload file using this 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

Binary protocols

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

Binary protocol

Select an image which you want to Upload .


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

Binary protocol

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

Binary protocol

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


Binary protocol

Thanks !!!


1 thought on “Upload File using Akka-HTTP and Binary protocol in Scala1 min read

Comments are closed.