nodester/nodester — Issue #296: fs, bad file descriptor
Author: iatek
Created: 2012-02-07 23:29:12+00:00
State: open

I saw the previous closed issues re: this. I'm trying to write image files using 'fs', but I'm still unable to do so.

I have created a 'files' folder off my app root, but when I try:

fs.writeFileSync(__dirname + '/files/' + filename, body, 'binary');

I get:

"Error: EBADF, Bad file descriptor '/app/files/6415031459_c3ce9f86e2_z.jpg'"

I have also tried:
fs.writeFileSync( './files/' + filename, body, 'binary')

AND

fs.writeFileSync( 'files/' + filename, body, 'binary');

What am I doing wrong> Is this possible?