Shopify/batman — Issue #183: File input types can't be serialized with jQuery
Author: hornairs
Created: 2011-10-17 20:37:50+00:00
State: open
Labels: Bug

Somewhere along the way file inputs got broken when using the jQuery platform adapter. The `file` DOM handler is supposed to tell the request adapter to use a `FormData` object to serialize the model data, but with the changes to the way `ContextProxies` work I think this may have been broken, so the adapter never finds out to use `FormData`, and jQuery craps out when trying to serialize the `File` object to send it.

The fix for now is just to tell your adapter to use `FormDatas` on all its requests:

```coffeescript
class Classifieds.Ad extends Classifieds.Model
adapter = @persist Batman.RailsStorage
adapter.defaultOptions.formData = true
```

This should be fixed at the `file` handler level however.