Forum Discussion
Error Message when clicking sharing video link in sharepoint
Yes, you can construct a hyperlink to an external website that bypasses the preview page in SharePoint by modifying the URL of the hyperlink. Here's an example of how you can construct the URL:
1. Get the direct link to the external website. You can do this by navigating to the website in your web browser and copying the URL from the address bar.
2. Construct the hyperlink URL. The hyperlink URL has the following format:
https://[domain].sharepoint.com/:v:/s/[site]/[document library]/[file name]?e=[expiration date]&download=1
Replace [domain], [site], [document library], [file name], and [expiration date] with the appropriate values for your SharePoint site and hyperlink file. Note that you can use any file name you want for the hyperlink file.
3. Modify the hyperlink URL. Replace the URL to the preview page in the hyperlink URL with the direct link to the external website. The modified URL should look something like this:
https://[domain].sharepoint.com/:v:/s/[site]/[document library]/[file name]?e=[expiration date]&download=1&web=1&url=[direct link to external website]
Note that the "&web=1" parameter has been added to the end of the URL to indicate that this is a web page hyperlink, and the "&url=[direct link to external website]" parameter has been added to specify the direct link to the external website.
Once you've modified the hyperlink URL, you can create a new hyperlink in SharePoint and use the modified URL instead of the original URL. This should bypass the preview page and go directly to the external website.
- AnonymousMay 10, 2023The [expiration date] parameter should be in UTC format and follow this format: yyyy-mm-ddThh:mm:ssZ. For example, 2023-06-01T12:00:00Z represents June 1, 2023, at 12:00:00 noon UTC.
here's an example of a full URL for a SharePoint file sharing link:
https://example.sharepoint.com/:v:/s/Marketing/Employees/CV12345.docx?e=2022-06-30T23%3A59%3A59Z&download=1&web=1&url=https://www.example.com
In this example:
- "example.sharepoint.com" is the domain for the SharePoint site
- "Marketing" is the name of the SharePoint site
- "Employees" is the name of the document library where the file is located
- "CV12345.docx" is the name of the file
- "2022-06-30T23%3A59%3A59Z" is the expiration date encoded in ISO 8601 format
- "&download=1" specifies that the file should be downloaded instead of previewed in the browser
- "&web=1" specifies that the link should be opened in the browser instead of the OneDrive app
- "&url=https://www.example.com" specifies a direct link to an external website
Note that the expiration date is URL-encoded to include the "T" separator and the "Z" time zone designator. The "&" character is also encoded as "&" in the URL.- barlageMay 10, 2023Brass Contributor
Deleted, this still isn't working for me and I need some clarification on a couple things.
- I included an expiration date in the URL I'm building, but I don't have an expiration date column in the library where I'm putting links. Do I need to create a column called 'ExpirationDate"? If yes, please include the exact syntax of what I need to name the column.
- In my picture below, this is how I am adding a link to my document library. I named my link 'google', but do you see how it adds the '.url' at the end of the name? It has 'google.url' in the details pane, so I'm using that.
Will you please attempt to create a link to an external page in your site pages library and view that list in a list viewer web part and see if this solution you propose is working for you?
- AnonymousMay 10, 2023
barlage Please copy the link which I send in a text editor, and see the full URL to understand its syntax
https://example.sharepoint.com/:v:/s/Marketing/Employees/CV12345.docx?e=2022-06-30T23%3A59%3A59Z&download=1&web=1&url=https://www.example.com
- I included an expiration date in the URL I'm building, but I don't have an expiration date column in the library where I'm putting links. Do I need to create a column called 'ExpirationDate"? If yes, please include the exact syntax of what I need to name the column.