Wednesday 15 July 2015

node.js - How to upload a file to Parse.com using simple HTML form? -


After

I want to upload a simple image file with a text value of Parse.com on the project . But either I'm not getting the correct enctype or the node of the pars is needed to make some changes. Can you help solve this issue? I am getting the post variable normally but to get anything when I am not able to send

a file with

Simplified HTML

  & lt; Form & gt; Question: & lt; Br> & Lt; Input type = "text" name = "questionstring" & gt; & Lt; Br> Username: & lt; Br> & Lt; Input type = "text" name = "username" & gt; & Lt; Input type = "file" name = "file" & gt; & Lt; / Form & gt;  

My Cloud Code

  app.post (function 'create', (request, race) {var user name = req.body.username; Var questionString = req.body.questionString; on positiveAnswer = req.body.positiveAnswer; on negativeAnswer = req.body.negativeAnswer; on email = req.body.email; console.log (user name + questionString + positiveAnswer + negativeAnswer + email + JSON .stringify (req.body); console.log ("Request Files:" + req.files);  

This document can help you:


No comments:

Post a Comment