Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still doesn't work on windows for 'show image right after uploading' #24

Closed
heaventear opened this issue Nov 11, 2012 · 1 comment
Closed

Comments

@heaventear
Copy link

The latest zipped code doesn't work on windows for file renaming. So I resort to file copying instead.

Dig in for a while. Come up with one solution. See below.

In the upload request handler, use code below for file copying.

fs.createReadStream(files.upload.path).
pipe(fs.createWriteStream('/tmp/test.jpg').
on('close', function(){
response.writeHead(200, {"Content-Type": "text/html"});
response.write("received image:
");
response.write("");
response.end();
}));

@blessanm86
Copy link

The above code worked for me on windows. But still needed to specify the paths with ./ instead of /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants