busboy

connect-busboy on('file') event not firing

和自甴很熟 提交于 2021-02-20 04:46:26
问题 I'm having issues with uploading files. I have the following code: App.js var bodyParser = require('body-parser'); var busboy = require('connect-busboy'); app.use(bodyParser.urlencoded({extended: false})); app.use(bodyParser.json()); app.use(busboy({immediate: true, limits: {fileSize: 25 * 1024 * 1024}})); Attachments.js router.post('/:table/:id', function (req, res) { req.busboy.on('file', function (fieldname, file, filename, encoding, mimetype) { //Do stuff.. }); }); The 'file' event is not

Receiving “Uploading file too fast!” error from Imgur API

本秂侑毒 提交于 2021-01-28 15:34:48
问题 I created a node.js server that uses busboy to take requests, and pipe the files to Imgur for upload. However, I keep getting an "Uploading file too fast!" response from Imgur, and I'm not sure exactly what the problem is. Here is the code snippet involving busboy: var express = require('express'); var Busboy = require('busboy'); var fs = require('fs'); var request = require('request-promise'); var router = express.Router(); router.post('/u', function(req, res, next) { var busboy = new Busboy

Receiving “Uploading file too fast!” error from Imgur API

只愿长相守 提交于 2021-01-28 15:33:09
问题 I created a node.js server that uses busboy to take requests, and pipe the files to Imgur for upload. However, I keep getting an "Uploading file too fast!" response from Imgur, and I'm not sure exactly what the problem is. Here is the code snippet involving busboy: var express = require('express'); var Busboy = require('busboy'); var fs = require('fs'); var request = require('request-promise'); var router = express.Router(); router.post('/u', function(req, res, next) { var busboy = new Busboy

Receiving “Uploading file too fast!” error from Imgur API

两盒软妹~` 提交于 2021-01-28 15:33:01
问题 I created a node.js server that uses busboy to take requests, and pipe the files to Imgur for upload. However, I keep getting an "Uploading file too fast!" response from Imgur, and I'm not sure exactly what the problem is. Here is the code snippet involving busboy: var express = require('express'); var Busboy = require('busboy'); var fs = require('fs'); var request = require('request-promise'); var router = express.Router(); router.post('/u', function(req, res, next) { var busboy = new Busboy

How to parse multipart/form-data on firebase cloud functions?

安稳与你 提交于 2021-01-27 05:21:47
问题 I've been trying to post a multipart/form-data object with text and an image file to one of my cloud functions, according to the documents here: https://cloud.google.com/functions/docs/writing/http#multipart_data_and_file_uploads I've kept my cloud function almost entirely the same as the example, except I've wrapped it in a CORS response. It seems though, that no matter what, busboy's 'field' and 'file' events never fire, and when I print the request body's toString method, I get some of the

req.busboy.on('file') not firing

狂风中的少年 提交于 2021-01-27 05:15:26
问题 I have the following form: form(method='post', action='/encoder_post', enctype='multipart/form-data') .form-group label(for='name') Name input.form-control(type='text', id='name', name='name') .form-group label(for='message') Message input.form-control(type='text', id='message', name='message') .form-group label(for='file') Audio File (*.wav) input.form-control(type='file', id='file') button.btn.btn-cicada.btn-block(type='submit') Submit Inside encoder_post , I have the following function to

req.busboy.on('file') not firing

吃可爱长大的小学妹 提交于 2021-01-27 05:15:22
问题 I have the following form: form(method='post', action='/encoder_post', enctype='multipart/form-data') .form-group label(for='name') Name input.form-control(type='text', id='name', name='name') .form-group label(for='message') Message input.form-control(type='text', id='message', name='message') .form-group label(for='file') Audio File (*.wav) input.form-control(type='file', id='file') button.btn.btn-cicada.btn-block(type='submit') Submit Inside encoder_post , I have the following function to

XMLHttpRequest.upload.onprogress not Working with HTTPS

这一生的挚爱 提交于 2020-08-07 01:29:07
问题 Issue I have a page where users can upload files with the help of FormData and an XMLHttpRequest . Uploading the file works fine. But the upload.onprogress is only working when uploading from an HTTP connection . HTTPS HTTP I've tested this on Heroku and on an Amazon EC2 instance. But it's always the same: Progress is shown when uploading via HTTP Progress event is never triggered when uploading via HTTPS Javascript (Angular 7) const xhr = new XMLHttpRequest(); let progress = 0; /** THIS