diff --git a/packages/survey-angular-ui/src/questions/file.component.html b/packages/survey-angular-ui/src/questions/file.component.html
index 25840b5878..20840bb9ee 100644
--- a/packages/survey-angular-ui/src/questions/file.component.html
+++ b/packages/survey-angular-ui/src/questions/file.component.html
@@ -13,6 +13,7 @@
[attr.multiple]="model.multipleRendered"
[attr.title]="model.inputTitle"
[attr.accept]="model.acceptedTypes"
+ [attr.capture]="model.renderCapture"
/>
-
+
diff --git a/src/question_file.ts b/src/question_file.ts
index bfee5f1417..48b7e2eec1 100644
--- a/src/question_file.ts
+++ b/src/question_file.ts
@@ -40,6 +40,7 @@ export class QuestionFileModel extends Question {
@property({ defaultValue: 0 }) indexToShow: number;
@property({ defaultValue: false }) containsMultiplyFiles: boolean;
+ @property() allowCameraAccess: boolean;
public mobileFileNavigator: ActionContainer = new ActionContainer();
protected prevFileAction: Action;
@@ -240,6 +241,9 @@ export class QuestionFileModel extends Question {
}
);
}
+ public get renderCapture(): string {
+ return this.allowCameraAccess ? "user" : undefined;
+ }
get multipleRendered() {
return this.allowMultiple ? "multiple" : undefined;
@@ -608,6 +612,7 @@ Serializer.addClass(
{ name: "correctAnswer", visible: false },
{ name: "validators", visible: false },
{ name: "needConfirmRemoveFile:boolean" },
+ { name: "allowCameraAccess:switch", category: "general" }
],
function () {
return new QuestionFileModel("");
diff --git a/src/react/reactquestion_file.tsx b/src/react/reactquestion_file.tsx
index 823fcab433..0de7aacfa3 100644
--- a/src/react/reactquestion_file.tsx
+++ b/src/react/reactquestion_file.tsx
@@ -56,6 +56,7 @@ export class SurveyQuestionFile extends SurveyQuestionElementBase {
multiple={this.question.allowMultiple}
title={this.question.inputTitle}
accept={this.question.acceptedTypes}
+ capture={this.question.renderCapture}
/>
);
return (
diff --git a/src/vue/file.vue b/src/vue/file.vue
index 2943f8fa82..51778c741c 100644
--- a/src/vue/file.vue
+++ b/src/vue/file.vue
@@ -14,6 +14,7 @@
:multiple="question.multipleRendered"
v-bind:title="question.inputTitle"
v-bind:accept="question.acceptedTypes"
+ :capture="question.renderCapture"
/>
+
+
+
+
Drag and drop a file here or click the button below and choose a file to upload.
+
+
+ No file chosen
+
+
+
+
\ No newline at end of file