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
var IncomingForm = require('formidable'); | |
var util = require('util'); | |
var EventEmitter = require('events').EventEmitter; | |
var GridStore = require('mongodb').GridStore; | |
var pauseStream = require('pause-stream'); | |
var ObjectID = require('mongodb').ObjectID; | |
function IncomingFormGridFS(opts) { | |
if(!(this instanceof IncomingFormGridFS)) return new IncomingFormGridFS(opts); | |
if(!opts.mongodbConnection) throw "Please provide mongodbConnection option!"; |
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
module.exports = rimraf | |
rimraf.sync = rimrafSync | |
var path = require("path") | |
, fs | |
try { | |
// optional dependency | |
fs = require("graceful-fs") | |
} catch (er) { |
This file has been truncated, but you can view the full file.
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
execve("/usr/local/bin/node", ["node", "app.js"], [/* 35 vars */]) = 0 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=26517, ...}) = 0 | |
close(3) = 0 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\36\0\0\0\0\0\0"..., 832) = 832 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=100728, ...}) = 0 |
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
var app = require('express')(); | |
var GridStore = require('mongodb').GridStore; | |
var ObjectID = require('mongodb').ObjectID; | |
var MongoClient = require('mongodb').MongoClient; | |
var Server = require('mongodb').Server; | |
var dbConnection; | |
MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) { | |
dbConnection = db; | |
app.listen(3000); |
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
var IncomingForm = require('formidable'); | |
var util = require('util'); | |
var EventEmitter = require('events').EventEmitter; | |
var GridStore = require('mongodb').GridStore; | |
var pauseStream = require('through'); | |
var ObjectID = require('mongodb').ObjectID; | |
function IncomingFormGridFS(opts) { | |
if(!(this instanceof IncomingFormGridFS)) return new IncomingFormGridFS(opts); | |
if(!opts.mongodbConnection) throw "Please provide mongodbConnection option!"; |
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
var uploader = function(req, res) { | |
var busboy = new Busboy({ headers: req.headers }); | |
busboy.on('file', function(fieldname, stream, filename, encoding, contentType) { | |
var pStream = pauseStream(); // use pause stream to have time to open the GridStore | |
stream.pipe(pStream.pause()); | |
console.log('POST ' + req.originalUrl + ' File: '+ filename + ' Field: ' + fieldname); | |
cntProcessingFiles++; |
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
<?php | |
/** | |
* Initialize the system | |
*/ | |
define('TL_MODE', 'FE'); | |
require 'system/initialize.php'; | |
$tl_filesIDs = array('3', '4', '5', '6'); |
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
var buildPath = 'build'; | |
var srcPath = 'src'; | |
var path = require('path'); | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to recursively match all subfolders: | |
// 'test/spec/**/*.js' |
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
var path = require('path'); | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to recursively match all subfolders: | |
// 'test/spec/**/*.js' | |
module.exports = function(grunt) { |
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
index index.php index.html index.html; | |
client_max_body_size 200M; | |
sendfile on; | |
error_page 404 /404.html; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location = /favicon.ico { |
OlderNewer