O'Reilly logo

Scalatra in Action by Stefan Ollinger Dave Hrycyszyn Ross A. Baker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Handling files

This chapter covers

  • Serving files to a client via HTTP
  • Receiving files from a client as an HTTP file upload

This chapter discusses how to implement file exchange over HTTP with Scalatra. As an example, you’ll build a basic document store application that acts as an HTTP-based file server. It will serve documents from the filesystem, and new documents can be uploaded by a client. The user interface is depicted in figure 6.1.

Figure 6.1. User interface for the document store example

6.1. Serving files

First we’ll discuss how to serve non-HTML files, such as text documents, web assets, and media files from a route. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required