Bancha/Bancha — Issue #27: DOCS: Example of Cake controller for file uploads
Author: wirtsi
Created: 2012-01-30 11:21:44+00:00
State: open

Hello

could anyone please give me an example of how the controller for file uploads should look like? I can add an upload field like this

```javascript
// model name and advanced configs can be set here
scaffold: {
// model name
target: 'Country',

// we're using the after interceptor for more complex changes
afterBuild: function(formConfig) {
console.debug(formConfig);
formConfig.items.push({
xtype: 'fileuploadfield',
fieldLabel: 'Upload',
name: 'upload'
});

}
},
```

but on save I get:
You are trying to decode an invalid JSON String
[{"type":"rpc","tid":2,"action":"Country","method":"read","result":{"success":true,"data":{"id":"2","code":"AX","name":"\u00c5LAND ISLANDS","continent":"Europe","support_agent":"test"}}}]

I take it that Bancha wants the image data in the response, the wiki says something about a extUpload parameter, but where do I set this? Without the fileUpload field all works fine!

All the best

wirtsi