Unable to upload image file to a published node.acs application

174 views
Skip to first unread message

niranjan...@gmail.com

unread,
Jun 19, 2014, 10:27:37 AM6/19/14
to node...@googlegroups.com

Hello Experts

I am trying to build a front end to my ACS database. As a part of the admin front end, users will upload images and I am using Photos object to save them. I am using following code to upload the photos to cloud db and it works like a charm on my local system.

var data = {
session_id:req.session.session_id,
photo: req.files.photo_file
};
data['photo_sizes[medium_500]'] = '500x333';
data['photo_sync_sizes[]'] = 'medium_500';

ACS.Photos.create(data, function(e) {
if(e.success && e.success === true){
// Update custom object with this photo
ACS.Objects.update({
session_id:req.session.session_id,
classname:objname,
id:objid,
fields: {
photo_id:e.photos[0].id,
photo_url:e.photos[0].urls.medium_500
}
},function(data) {
if(data.success) {
// console.log('Updated successfully:' + JSON.stringify(data));
res.send(data);
}else {
console.log('Error:\n' +
((data.error && data.message) || JSON.stringify(data)));
}
}
);
//res.send(data);
}else{
logger.debug('Error: ' + JSON.stringify(e));
req.session.flash = {msg:e.message, r:0};
res.redirect('/');
}
});

But when I publish the app to the as Node.acs service, while uploading the images, app crashes. Running the "loglist" command produced following output.

[ERROR] [1233] Error: EACCES, open '/tmp/292fb15dcab44f58a315515bd9e70a8a'

This is the path that HTML form sends from the client as part of the form data that contains the file input. Please let me know how to solve this issue.

I have followed the blog tutorial here

http://www.appcelerator.com/blog/2012/11/node-acs-tutorial-1-pixgrid-photo-uploader/

Thanks and Regards,

Niranjan

Wei Kong

unread,
Jun 19, 2014, 7:49:24 PM6/19/14
to node...@googlegroups.com
Hi Niranjan,

Sorry to hear that you had run into problem.  There was some file permission issue. Can you please try again? 

Thanks,
Wei



--
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.

niranjan...@gmail.com

unread,
Jun 19, 2014, 11:14:27 PM6/19/14
to node...@googlegroups.com
Thanks Wei !

Yes it started working without any change in my code !! Super !

Regards,

Niranjan
Reply all
Reply to author
Forward
0 new messages