Skip to content

Commit

Permalink
Added file format restriction for upload
Browse files Browse the repository at this point in the history
* Allows only '.prototxt' file for Caffe
* Allows only '.pbtxt' file for Tensorflow
  • Loading branch information
utsavgarg committed Jun 24, 2017
1 parent 7d00920 commit a51edde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ide/static/bundle/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -43719,7 +43719,7 @@
{ htmlFor: "inputFilecaffe" },
"caffe"
),
_react2.default.createElement("input", { id: "inputFilecaffe", type: "file", onChange: function onChange() {
_react2.default.createElement("input", { id: "inputFilecaffe", type: "file", accept: ".prototxt", onChange: function onChange() {
return _this2.props.importNet('caffe');
} })
)
Expand All @@ -43735,7 +43735,7 @@
{ htmlFor: "inputFiletensorflow" },
"tensorflow"
),
_react2.default.createElement("input", { id: "inputFiletensorflow", type: "file", onChange: function onChange() {
_react2.default.createElement("input", { id: "inputFiletensorflow", type: "file", accept: ".pbtxt", onChange: function onChange() {
return _this2.props.importNet('tensorflow');
} })
)
Expand Down
4 changes: 2 additions & 2 deletions ide/static/js/topBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class TopBar extends React.Component {
<li>
<a>
<label htmlFor="inputFilecaffe">caffe</label>
<input id="inputFilecaffe" type="file" onChange={() => this.props.importNet('caffe')}/>
<input id="inputFilecaffe" type="file" accept=".prototxt" onChange={() => this.props.importNet('caffe')}/>
</a>
</li>
<li>
<a>
<label htmlFor="inputFiletensorflow">tensorflow</label>
<input id="inputFiletensorflow" type="file" onChange={() => this.props.importNet('tensorflow')}/>
<input id="inputFiletensorflow" type="file" accept=".pbtxt" onChange={() => this.props.importNet('tensorflow')}/>
</a>
</li>
<li><a href="#" onClick={() => this.props.importNet('url')}>url</a></li>
Expand Down

0 comments on commit a51edde

Please sign in to comment.