Chapter 5. Dealing with Files

When you are building a Backbone application you will consume resources from a RESTful web service; however most of the RESTful services use the JSON format to encode information, but JSON is not suitable to send and receive files. How we can send files to a RESTful server?

If you are developing an application that is not JavaScript–intensive, you can send files through an HTML form, but in Single Page Applications (SPA) this is not the best way to do it. Another issue is that Backbone does not provide an easy mechanism to send files because it is not compatible with the RESTful specification.

But web applications need to work with files. There are some approaches to deal with this common issue. For example, you could ...

Get Mastering Backbone.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.