In the app.js I am using "app.use(express.bodyParser());" But when the requisition pass across of "req.files" the error happen. =S
$ cat app.js
// initialize app
function start(app, express) {
app.use(express.favicon(__dirname + '/public/images/favicon.ico')); //set favicon
app.use(express.bodyParser());
}
// release resources
function stop() {
}
$ cat controllers/application.js
function index(req, res) {
console.log('paul');
console.log(req.files);
res.render('index', {
title: 'Welcome to Node.ACS!'
});
}
$ curl -F "file1=@config.json" http://localhost:8080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Node.ACS!</title>
<link rel='stylesheet' href='/css/style.css' />
</head>
<body>
<h2>Node.ACS</h2>
<p>Welcome to Node.ACS!</p>
</body>
</html>
$ acs run
ACS: Appcelerator Cloud Services Command-Line Interface, version 1.0.16
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
[DEBUG] dependency => async@>=0.9.0
[INFO] Installing dependencies...
[INFO] Dependencies installed.
[INFO] socket.io started
[INFO] ACS started on port 8080
[INFO] paul
[INFO] { file1:
{ domain: null,
_events: {},
_maxListeners: 10,
size: 266,
path: '/tmp/2998aea0fa6fd67c548b38cf16905faa',
name: 'config.json',
type: 'application/octet-stream',
hash: false,
lastModifiedDate: Tue Aug 26 2014 09:46:57 GMT+0800 (CST),
_writeStream:
{ _writableState: [Object],
writable: true,
domain: null,
_events: {},
_maxListeners: 10,
path: '/tmp/2998aea0fa6fd67c548b38cf16905faa',
fd: null,
flags: 'w',
mode: 438,
start: undefined,
pos: undefined,
bytesWritten: 266,
closed: true },
length: [Getter],
filename: [Getter],
mime: [Getter] } }
Someone know how pass an ImageView.image of titanium to Node.ACS... I am trying pass this image, but always of side of Node.ACS I have a "HTTP ERROR".
In the app.js I am using "app.use(express.bodyParser());" But when the requisition pass across of "req.files" the error happen. =S
--
You received this message because you are subscribed to the Google Groups "Node.ACS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-acs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi.
Now I see that my problem is happening at the Titanium Mobile side.
At the Ti Studio I have created a ACS webservice "PostPhoto", but I don't know how to pass the ImageView.image to the webservice method, so this way the Node.ACS understand that it is a File Upload and put the content under req.files.