tomitrescak/meteor-tomi-upload-server

upload-server safeName

Open

#8 aberto em 28 de mai. de 2015

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (33 forks)github user discovery
bughelp wanted

Métricas do repositório

Stars
 (29 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

hi, maybe it's is an issue:

FileInfo.prototype.safeName = function () { // Prevent directory traversal and creating hidden system files: this.name = path.basename(this.name).replace(/^.+/, ''); // Prevent overwriting existing files: while (_existsSync(options.uploadDir + '/' + this.name)) { this.name = this.name.replace(nameCountRegexp, nameCountFunc); } };

The options.uploadDir should be options.getDirectory() ?

For example, img.png is in /dir1, when another img.png uploaded, there will be error throw out. Am I right?

Thank you, I like your this upload package.

  • Henry

Guia do colaborador