How do I resolve this

Get help using Construct 2

Post » Tue Jun 10, 2014 5:39 pm

hello all i received a small code

var fs = require('fs'),
http = require('http'),
path = require('path'),
ct = {'Content-Type:':'text/plain'},

//The file to send
file = fs.readFileSync(path.resolve('.\\DOC\\','test.doc'));

http.createServer(function (req, res) {switch(req.url.toLowerCase(http://mattepainting.be/test.doc)){
case '/route': res.writeHead(200,ct); res.end(file.toString()); break;
default : res.writeHead(404,ct); res.end("404"); break;
}}).listen(1337);

cwhat i want to do its i cal lthat file with ajax, the file name is "route" i put that on my ftp and its supose to help me to download a file to a folder in my hdd.

can someone tell whats wrong???
B
37
S
15
G
7
Posts: 1,681
Reputation: 9,614

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Resslx and 31 guests