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: articles/communication-services/tutorials/file-sharing-tutorial-acs-chat.md
+93-53Lines changed: 93 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ The diagram shows a typical flow of a file sharing scenario for both upload and
58
58
59
59
You can follow the tutorial [Upload file to Azure Blob Storage with an Azure Function](/azure/developer/javascript/how-to/with-web-app/azure-function-file-upload) to write the backend code required for file sharing.
60
60
61
-
Once implemented, you can call this Azure Function inside the `uploadHandler` function to upload files to Azure Blob Storage. For the remaining of the tutorial, we assume you have generated the function using the tutorial for Azure Blob Storage linked previously.
61
+
Once implemented, you can call this Azure Function inside the `handleAttachmentSelection` function to upload files to Azure Blob Storage. For the remaining of the tutorial, we assume you have generated the function using the tutorial for Azure Blob Storage linked previously.
62
62
63
63
### Securing your Azure Blob storage container
64
64
@@ -91,7 +91,7 @@ Use the `npm install` command to install the beta Azure Communication Services U
By default, the file `url` provided through `notifyUploadCompleted` method is used to trigger a file download. However, if you need to handle a download in a different way, you can provide a custom `downloadHandler` to ChatComposite. Next, we modify the `fileDownloadHandler` that we declared previously to check for an authorized user before allowing to download the file.
303
+
By default, the UI library will open a new tab pointing to the URL you have set when you `notifyUploadCompleted`. Alternatively, you can have a custom logic to handle attachment downloads via `actionsForAttachment`. Let's take a look of an example.
// you can also override the default action partially
350
+
{
351
+
...defaultAttachmentMenuAction,
352
+
onClick: () => {
353
+
returnnewPromise((resolve, reject) => {
354
+
window.alert("default button clicked");
355
+
resolve();
356
+
})
357
+
}
358
+
}
359
+
];
320
360
}
321
-
};
361
+
}
322
362
```
323
363
324
-
Download errors are displayed to users in an error bar on top of the Chat Composite.
364
+
If there were any issues during the download and the user needs to be notified, we can just `throw` an error with a message in the `onClick` function then the message would be shown in the error bar on top of the Chat Composite.
325
365
326
366

0 commit comments