21
Views
7
Comments
Solved
How do I check for broken links?(How to Verify External Links for File Accessibility)
Question
Application Type
Reactive

How do I check for broken links?
Thank you!

2020-08-31 05-04-40
Rahul Jain
Solution

Hello ,

Please try by below url and find attached OML file.
Demo URL : https://rahul-jain-doitlean.outsystemscloud.com/API/GetStatus

Thanks

--RJ--


GetStatus.oml
2023-12-22 05-02-09
_N_C_

Thank you!

2024-12-02 13-16-47
Vipin Yadav

Hi @_N_C_ ,

Could you please explain a bit more so that I can understand and assist you? 

Thanks,

Vipin Yadav

2023-12-22 05-02-09
_N_C_

I need to check if the file is accessible through the external link and ensure the link is not broken.

2024-12-18 16-06-42
Junaid Syed

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

2024-07-18 10-54-11
Abhishek Hayaran

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);

    return false;

  }

}


2023-12-22 05-02-09
_N_C_

If you have OML, can you share?

2020-08-31 05-04-40
Rahul Jain
Solution

Hello ,

Please try by below url and find attached OML file.
Demo URL : https://rahul-jain-doitlean.outsystemscloud.com/API/GetStatus

Thanks

--RJ--


GetStatus.oml
2023-12-22 05-02-09
_N_C_

Thank you!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.