Download form URL and be able to click on it

Eduardo Gomez 3,416 Reputation points
2023-01-28T16:34:04.32+00:00

So, I am doing shared file functionality. Right now, I am successfully uploading the file to Azure, and then putting the link in an email address, but I have some problems

  1. Even though I am inserting a URL, is not blue (Like a URL, that I can click on)
  2. because I am sharing documents, if you put the URL in the browser, it will open it and I want to download the file or attach it to the email
private async void ShareAction(FileItem file) {

            AzureStorageService azureStorageService = new();

            await azureStorageService.UploadToAzureBlobStorage(file.FilePath);

            string link = $"https://transcribemedocs.blob.core.windows.net/cloudfilesshare/{Path.GetFileName(file.FilePath)}";
            string subject = "Here is the link for your file";

            var destinationurl = $"mailto:?subject={subject}&body={link}%0D";
            var sInfo = new ProcessStartInfo(destinationurl) {
                UseShellExecute = true,
            };
            Process.Start(sInfo);

User's image

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,671 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,846 Reputation points
    2023-01-29T13:25:49.03+00:00

    try something like this

     var destinationurl = $"mailto:?subject={subject}&body=<a href='{link}%0D'>your file</a>";