Redux adapter to fileup-core
- Append fileup reducer to application reducers:
import fileup from 'fileup-redux/lib/reducers/fileup';
export default combineReducers({
fileup,
//...
});
- Decorate you React Component with fileup:
import fileup from 'fileup-redux';
class MyFiles extends React.Component {
render() {
return (
<div>
{this.props.files.map(file => (
<div key={file.uid}>
{file.name}
</div>
))}
<button onClick={() => this.props.uploader.browse()}>Browse</button>
</div>
);
}
}
export default fileup({
backendUrl: '/file/upload/',
})(MyFiles);
id
Unique identifier in redux storebackendUrl
Backend url to file uploaduploader
FileUp configuration