Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-uploader-ta

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-uploader-ta

Programmatic multipart file uploads. Designed for testing file uploads. Temporary fixes fork of https://github.com/timoxley/file-uploader

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

build status

File Uploader

This module allows you to easily test the file uploading capabilities of your API by allowing you to perform a multipart file upload programmatically.

Usage


var uploader = require('file-uploader')

var file   // set to the path of the file you want to upload
var cookie // set a cookie if you require authorisation

var options = {
  host : 'localhost',
  port : 4000,
  path : '/upload',
  method : 'POST',
  encoding : 'utf8'
}

uploader.postFile(options, file, {Cookie: cookie}, function(err, res) {
  console.log(res.statusCode)
})

Alternative: Superagent/Supertest

Recently I've been using the superagent and supertest modules to send/test file attachments. The interface is clean, and they provide other essential HTTP requesting and testing functionality. I recommend you try them out before doing anything else, ever.

Credits

Code originally taken(stolen?) from Anand Prakash: http://www.anandprakash.net/2011/10/20/server-side-multipartform-data-uploads-from-nodejs/

Current version has slight modification and bugfixes.

If Anand Prakash wants to take ownership this repository, he's more than welcome to.

Test Image By Microchip08 (talk) as well as those of Image:Recycled kitten.jpg (Image:Recycled kitten.jpg) [GFDL (www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (www.creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons

Keywords

FAQs

Package last updated on 14 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc