How to use the form-data.LINE_BREAK function in form-data

To help you get started, we’ve selected a few form-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paypal / appsforhere / controllers / locations.js View on Github external
}
                        bodyBuffers.push(chunk);
                    });
                    form.on('error', function (err) {
                        loc.success = false;
                        loc.message = err.message;
                        res.json(loc);
                        return;
                    });
                    form.append('file', response.body, {
                        header: '--' + form.getBoundary() + FormData.LINE_BREAK +
                            'Content-Disposition: form-data; name=file' +
                            '; filename=file' + FormData.LINE_BREAK +
                            'Content-Transfer-Encoding: binary' + FormData.LINE_BREAK +
                            'Content-Type: ' + response.headers['content-type'] +
                            '; name=file' + FormData.LINE_BREAK + FormData.LINE_BREAK
                    });
                    form.resume();
                }));
            });
github paypal / appsforhere / controllers / locations.js View on Github external
}));
                    });
                    form.on('data', function (chunk) {
                        if (typeof(chunk) === 'string') {
                            chunk = new Buffer(chunk, 'binary');
                        }
                        bodyBuffers.push(chunk);
                    });
                    form.on('error', function (err) {
                        loc.success = false;
                        loc.message = err.message;
                        res.json(loc);
                        return;
                    });
                    form.append('file', response.body, {
                        header: '--' + form.getBoundary() + FormData.LINE_BREAK +
                            'Content-Disposition: form-data; name=file' +
                            '; filename=file' + FormData.LINE_BREAK +
                            'Content-Transfer-Encoding: binary' + FormData.LINE_BREAK +
                            'Content-Type: ' + response.headers['content-type'] +
                            '; name=file' + FormData.LINE_BREAK + FormData.LINE_BREAK
                    });
                    form.resume();
                }));
            });

form-data

A library to create readable "multipart/form-data" streams. Can be used to submit forms and file uploads to other web applications.

MIT
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis