122
rated 0 times
[
126]
[
4]
/ answers: 1 / hits: 5227
/ 11 Years ago, mon, january 27, 2014, 12:00:00
I am trying to write a simple upload form with input file type using React JS. When i submit the file, it is not submitting multi form data. It is submitting plain input file name.
Do we need to make any other changes if we want to write upload functionality in React.
Basic javascript code for uploading (js fiddle link) :
/** @jsx React.DOM */
var HelloMessage = React.createClass({
render: function() {
return (<div>
<form name=secret ENCTYPE=multipart/form-data method=POST action=http://localhost:8080/uploadFile>
Please choose two files to upload.
<br/>
File 1:<input type=file id=profilePic name=profilePic/>
<br/>
<input type=submit value=submit/>
</form>
</div>);
}
});
React.renderComponent(<HelloMessage />, document.body);
Can someone help me to write using React JS.
More From » html