File uploading (type:'file')
Open in new window

Preview the image: default is false.

survey.getQuestionByName('image').showPreview = yourValue; survey.render();

Store file content directoy in data JSON: default is false.

survey.getQuestionByName('image').storeDataAsText = yourValue; survey.render();

Image Preview Height: default is empty.

survey.getQuestionByName('image').imageHeight; survey.render();

Image Preview Width: default is empty.

survey.getQuestionByName('image').imageWidth; survey.render();

File Max Size (in bytes): default is 0 (no limits).

survey.getQuestionByName('image').maxSize; survey.render();


Survey.Survey.cssType = "bootstrap";
Survey.defaultBootstrapCss.navigationButton = "btn btn-green";

window.survey = new Survey.Model({ questions: [
    { type: "file", title: "Please upload your photo", name: "image", storeDataAsText: true, showPreview: true, imageWidth: 150, maxSize: 102400 }
]});
survey.onComplete.add(function(result) {
	document.querySelector('#surveyResult').innerHTML = "result: " + JSON.stringify(result.data);
});


$("#surveyElement").Survey({model:survey});


<!DOCTYPE html>
<html>

<head>
    <title>Welcome to JQuery</title>
    <script src="https://unpkg.com/jquery"></script>
    
    <script src="https://surveyjs.azureedge.net/0.12.18/survey.jquery.js"></script>
    
    
    <link rel="stylesheet" href="https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="./index.css">
</head>

<body>
    <div id="surveyElement"></div>
    <div id="surveyResult"></div>
    <script src="./index.js"></script>
</body>

</html>

.btn-green {
  background-color: #1ab394;
  color: #fff;
  border-radius: 3px;
}

.btn-green:hover, .btn-green:focus {
    background-color: #18a689;
    color: #fff;
}

.panel-footer {
    text-align: right;
    background-color: #fff;
}