I am trying to add filepond framework for me image input but whenever I try to submit my data it gets
Error: ER_DATA_TOO_LONG: Data too long for column.
I tried to add the issue in their GitHub because I believe that it is because of the framework or I am missing any dependencies for the framework but they replied:
Hi, this is a MySQL question and not a question related to FilePond library, please ask it on Stack Overflow.
.ejs file
<form class="add-music-form" action="/save" method="post">
<div class="form-group filepond-custom-style">
<input type="file" name="filepond">
</div>
<div class="form-group margin-top">
<input type="text" class="form-control" placeholder="Title" id="title" name="title">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Band name" id="band_name" name="band_name">
</div>
<div class="form-group custom-file">
<input type="file" class="custom-file-input" id="customFile" name="audio">
<label class="custom-file-label" for="customFile">Select audio file</label>
</div>
<div class="mt-3">
<button type="submit" class="btn btn-primary">Submit</button>
<a data-dismiss="modal" class="btn btn-default">Cancel</a>
</div>
</form>
app.js
app.post('/save',(req, res) => {
let data = {filepond: req.body.filepond, title: req.body.title, band_name: req.body.band_name, audio: req.body.audio};
let sql = "INSERT INTO music SET ?";
let query = connection.query(sql,data,(err, results) => {
if(err) throw err;
res.redirect('/');
});
});