formidable

File upload: create directory if it doesnt exist

我的梦境 提交于 2019-12-01 08:28:01
I´m handling file uploads in NodeJS with formidable. This works for me. Now I want to structure the uploads a little more. I´m passing a field from angular with my uploads, which is a project_id . I want to create a folder in my uploads, named by this ID and write the files in it. So I check if the directory exists, if not I create it with fs.mkdir and then write the files to it. Trying this, I get a EINVAL, rename error and a HTTP 500 status code. This is my attempt, anybody got an idea how to fix this? app.post('/uploads/', function(req, res, next){ var form = new formidable.IncomingForm();

File upload: create directory if it doesnt exist

冷暖自知 提交于 2019-12-01 04:12:50
问题 I´m handling file uploads in NodeJS with formidable. This works for me. Now I want to structure the uploads a little more. I´m passing a field from angular with my uploads, which is a project_id . I want to create a folder in my uploads, named by this ID and write the files in it. So I check if the directory exists, if not I create it with fs.mkdir and then write the files to it. Trying this, I get a EINVAL, rename error and a HTTP 500 status code. This is my attempt, anybody got an idea how

Stream uploading file to S3 on Node.js using formidable and (knox or aws-sdk)

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 19:41:07
I'm trying to stream upload a file submitted via a form directly to an Amazon S3 bucket, using aws-sdk or knox . Form handling is done with formidable . My question is: how do I properly use formidable with aws-sdk (or knox) using each of these libraries' latest features for handling streams? I'm aware that this topic has already been asked here in different flavors, ie: How to receive an uploaded file using node.js formidable library and save it to Amazon S3 using knox? node application stream file upload directly to amazon s3 Accessing the raw file stream from a node-formidable file upload

Stream uploading file to S3 on Node.js using formidable and (knox or aws-sdk)

偶尔善良 提交于 2019-11-27 12:27:57
问题 I'm trying to stream upload a file submitted via a form directly to an Amazon S3 bucket, using aws-sdk or knox. Form handling is done with formidable. My question is: how do I properly use formidable with aws-sdk (or knox) using each of these libraries' latest features for handling streams? I'm aware that this topic has already been asked here in different flavors, ie: How to receive an uploaded file using node.js formidable library and save it to Amazon S3 using knox? node application stream