How do I check for broken links?Thank you!
Hello ,
Please try by below url and find attached OML file.Demo URL : https://rahul-jain-doitlean.outsystemscloud.com/API/GetStatus
Thanks
--RJ--
Thank you!
Hi @_N_C_ ,
Could you please explain a bit more so that I can understand and assist you?
Thanks,
Vipin Yadav
I need to check if the file is accessible through the external link and ensure the link is not broken.
I don't think there is a built in support for that. There are third party tools available, you might want to explore them and integrate the desired one to the platform to be able to meet your needs.
Hope it helps!
Junaid
To check if a link is broken programmatically in JavaScript, particularly if it's a link to download a file from a third-party application, you can make an HTTP request to that link and observe the response. This can be done using the fetch API available in modern JavaScript environments.
Here's a basic example of how to achieve this:
javascriptCopy codeasync function checkLink(url) {
try {
// Make a HEAD request to the URL
let response = await fetch(url, {
method: 'HEAD',
mode: 'no-cors' // to prevent CORS errors, but note that this will limit the visibility of certain response attributes
});
// Check if the link is working based on the status code
if (response.ok) {
console.log('Link is working');
return true;
} else {
console.log('Link is broken', response.status);
return false;
}
} catch (error) {
// If the request fails, the link might be broken or there might be a network issue
console.error('Error checking link:', error);
If you have OML, can you share?