Comments (5)
busboy
has a defCharset
option that allows you to change the default charset (from the default value of 'utf8'
):
var Busboy = require('busboy');
var busboy = new Busboy({ defCharset: 'windows-1251', headers: ... });
If you're using connect-busboy
, then you can pass settings directly to busboy
:
var busboy = require('connect-busboy');
app.use(busboy({ defCharset: 'windows-1251' }));
from connect-busboy.
sorry, but i got same error 415 unsupported charset "WINDOWS-1251"
in route, i set
var Busboy = require('busboy');
var payment = {
result : function(req, res, next) {
var busboy = new Busboy({ headers: req.headers, defCharset: 'windows-1251' });
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
console.log('File [' + fieldname + ']: filename: ' + filename + ', encoding: ' + encoding + ', mimetype: ' + mimetype);
file.on('data', function(data) {
console.log('File [' + fieldname + '] got ' + data.length + ' bytes');
});
file.on('end', function() {
console.log('File [' + fieldname + '] Finished');
});
});
busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated, encoding, mimetype) {
console.log('Field [' + fieldname + ']: value: ' + val);
});
busboy.on('finish', function() {
console.log('Done parsing form!');
res.end();
});
req.pipe(busboy);
}
}
module.exports = payment;
i asked semilar question
thanks for help
from connect-busboy.
If you're getting the same error as the one you show in your SO question, then you're still using body-parser
instead of (or before) busboy
then. busboy
would not generate an error like that.
from connect-busboy.
Yeesssssssssssss! WORK! You save my life! Thanks!
from connect-busboy.
Glad to hear you got it working!
from connect-busboy.
Related Issues (20)
- How to handle undefined upload HOT 2
- busboy not firing finish - stackoverflow answer HOT 1
- busboy finish event HOT 1
- Application freezes when no or not all files are uploaded HOT 2
- Issue upload files on iPad / iPhone HOT 5
- async routing function stops the busboy events from firing HOT 1
- EPIPE Error when uploading large file using nodejs HOT 5
- File get corrupt only when I upload a pdf to s3 HOT 1
- Busboy dependency now broken HOT 2
- Connect 500 TypeError: Busboy is not a constructor HOT 2
- can not read all chunk of the files HOT 1
- "Finish" and "field" events does not work when "file" event is added. HOT 5
- SyntaxError: Unexpected token { HOT 1
- Getting Error while uploading file "Unexpected end of form at Multipart._final" HOT 1
- Event for fileSize limit? HOT 1
- Example not working? HOT 3
- Using busboy special event 'filesLimit' with nodejs and express. HOT 5
- file event is not triggered HOT 14
- 'TypeError: Cannot call method 'on' of undefined' error with POST HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect-busboy.