title: How to check if the file exists in js with ROR code in back end?
body: <p>I'm new to JS,can anyone tell me how to check if the file exists in the mentioned path in js ? In the back end i am using ROR .</p>
  
  <p>Ex: In the UI I enter a path where a particular file need to be exported . Before the export function takes place a check needs to be done. </p>
  
  <p>Export function should not take place if the file already exists and an alert message should be displayed to the user .</p>
  
  <p>Thanks.</p>