Created
May 26, 2016 14:58
-
-
Save betahikaru/d7f2ad345778310fbe3c11b817cad4f0 to your computer and use it in GitHub Desktop.
React.jsのformタグは 正:encType 誤:enctype ref: http://qiita.com/betahikaru/items/d5d35b6c87cab89d1ff5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ソース | |
var SomeComponent = React.createClass({ | |
... | |
render: function() { | |
return ( | |
<form action="/upload" method="POST" encType="multipart/form-data"> | |
<input type="file" name="file_input" /> | |
<input type="submit" value="Upload" /> | |
</form> | |
); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- レンダリング結果 - enctype属性が存在する😊 --> | |
<form action="/api/file" method="POST" enctype="multipart/form-data"> | |
<input type="file" name="file1"> | |
<input type="submit" value="Upload"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ソース | |
var SomeComponent = React.createClass({ | |
... | |
render: function() { | |
return ( | |
<form action="/upload" method="POST" enctype="multipart/form-data"> | |
<input type="file" name="file_input" /> | |
<input type="submit" value="Upload" /> | |
</form> | |
); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- レンダリング結果 - enctype属性が存在しない!😢 --> | |
<form action="/api/file" method="POST"> | |
<input type="file" name="file1"> | |
<input type="submit" value="Upload"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment