This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uploading file directly on mongodb with gridfs-stream and multer express middleware | |
var multer = require('multer'); | |
var express = require('express'); | |
var mongoose = require('mongoose') | |
var Grid = require('gridfs-stream'); | |
var conecction = function() { | |
var conn = mongoose.createConnection('localhost', 'fs_model', 27017).once('open', function() { | |
console.log('CONECTADO A fs_model'); | |
})//end open connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uploading file directly on mongodb with gridfs-stream and multer express middleware | |
, multer = require('multer'); | |
var dispatch = function(gfs) { | |
var stacks = [];//take all files | |
return multer({ | |
onFileUploadStart:function(file){ | |
stacks.push(gfs.createWriteStream({ | |
filename:file.name, | |
mode:"w", | |
chunkSize:1024*4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uploading file directly on mongodb with gridfs-stream and multer express middleware | |
, multer = require('multer'); | |
var dispatch = function(gfs) { | |
var stacks = [];//take all files | |
return multer({ | |
onFileUploadStart:function(file){ | |
stacks.push(gfs.createWriteStream({ | |
filename:file.name, | |
mode:"w", | |
chunkSize:1024*4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uploading file directly on mongodb with gridfs-stream and multer express middleware | |
, multer = require('multer'); | |
var dispatch = function(gfs) { | |
var stacks = [];//take all files | |
return multer({ | |
onFileUploadStart:function(file){ | |
stacks.push(gfs.createWriteStream({ | |
filename:file.name, | |
mode:"w", | |
chunkSize:1024*4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uploading file directly on mongodb with gridfs-stream and multer express middleware | |
, multer = require('multer'); | |
var dispatch = function(gfs) { | |
var stacks = [];//take all files | |
return multer({ | |
onFileUploadStart:function(file){ | |
stacks.push(gfs.createWriteStream({ | |
filename:file.name, | |
mode:"w", | |
chunkSize:1024*4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uploading file directly on mongodb with gridfs-stream and multer express middleware | |
, multer = require('multer'); | |
var dispatch = function(gfs) { | |
var stacks = [];//take all files | |
return multer({ | |
onFileUploadStart:function(file){ | |
stacks.push(gfs.createWriteStream({ | |
filename:file.name, | |
mode:"w", | |
chunkSize:1024*4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<doctype html> | |
<head> | |
<meta charset="utf-8"> | |
<lang="es"> | |
<link rel="stylesheet" type="text/css" href="estilo.css"> | |
<script src="http://code.jquery.com/jquery-2.0.0.min.js"></script> | |
</head> | |
<body> | |
<section> | |
<div> |