You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/actions/media-upload/MediaUploadDocumentation.md
+53-51Lines changed: 53 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ This allows users to upload media content via an ACE. The current size limitatio
26
26
The ACE action for Select Media is: `VivaAction.SelectMedia`.
27
27
28
28
The parameters that it takes are as follows:
29
+
29
30
-`mediaType`: This is set to image by default as audio is still under works.
30
31
-`allowMultipleCapture`[OPTIONAL]: This enables multiple files to be added at once.
31
32
- This is enabled by default.
@@ -35,24 +36,25 @@ The parameters that it takes are as follows:
35
36
36
37
```typescript
37
38
{
38
-
/**
39
-
* Specify the specific media type that should be selected
40
-
*/
41
-
mediaType: MediaType;
42
-
/**
43
-
* Allow multiple images to be selected.
44
-
*/
45
-
allowMultipleCapture?:boolean;
46
-
/**
47
-
* Max file size that can be uploaded.
48
-
*/
49
-
maxSizePerFile?:number;
50
-
/**
51
-
* File formats supported for upload.
52
-
*/
53
-
supportedFileFormats?:string[];
39
+
/**
40
+
* Specify the specific media type that should be selected
41
+
*/
42
+
mediaType: MediaType;
43
+
/**
44
+
* Allow multiple images to be selected.
45
+
*/
46
+
allowMultipleCapture?:boolean;
47
+
/**
48
+
* Max file size that can be uploaded.
49
+
*/
50
+
maxSizePerFile?:number;
51
+
/**
52
+
* File formats supported for upload.
53
+
*/
54
+
supportedFileFormats?:string[];
54
55
}
55
56
```
57
+
56
58
### Tutorial and Examples
57
59
58
60
You can take a look at [this tutorial](./MediaUploadTutorial.md) which goes over a step by step guide on how to create a card with the available media upload action.
@@ -61,62 +63,62 @@ You can take a look at [this tutorial](./MediaUploadTutorial.md) which goes over
61
63
In your template json file add the following action:
62
64
```json
63
65
"actions": [
64
-
{
65
-
"type": "VivaAction.SelectMedia",
66
-
"id": "Select Media",
67
-
"title": "Upload Image",
68
-
"parameters": {
69
-
"mediaType": "MediaType.Image"
70
-
}
71
-
}
66
+
{
67
+
"type": "VivaAction.SelectMedia",
68
+
"id": "Select Media",
69
+
"title": "Upload Image",
70
+
"parameters": {
71
+
"mediaType": "MediaType.Image"
72
+
}
73
+
}
72
74
]
73
75
```
74
76
75
77
1.**Upload multiple images**
76
78
In your template json file add the following action:
77
79
```json
78
80
"actions": [
79
-
{
80
-
"type": "VivaAction.SelectMedia",
81
-
"id": "Select Media",
82
-
"title": "Upload Image",
83
-
"parameters": {
84
-
"mediaType": "MediaType.Image",
85
-
"allowMultipleCapture": true
86
-
}
87
-
}
81
+
{
82
+
"type": "VivaAction.SelectMedia",
83
+
"id": "Select Media",
84
+
"title": "Upload Image",
85
+
"parameters": {
86
+
"mediaType": "MediaType.Image",
87
+
"allowMultipleCapture": true
88
+
}
89
+
}
88
90
]
89
91
```
90
92
91
93
1.**Upload only JPG images**
92
94
In your template json file add the following action:
93
95
```json
94
96
"actions": [
95
-
{
96
-
"type": "VivaAction.SelectMedia",
97
-
"id": "Select Media",
98
-
"title": "Upload Image",
99
-
"parameters": {
100
-
"mediaType": "MediaType.Image",
101
-
"supportedFileFormats": "jpg"
102
-
}
103
-
}
97
+
{
98
+
"type": "VivaAction.SelectMedia",
99
+
"id": "Select Media",
100
+
"title": "Upload Image",
101
+
"parameters": {
102
+
"mediaType": "MediaType.Image",
103
+
"supportedFileFormats": "jpg"
104
+
}
105
+
}
104
106
]
105
107
```
106
108
107
109
1.**Upload allow only small images to be uploaded**
108
110
In your template json file add the following action:
0 commit comments