Forum Discussion
smithme
May 29, 2020Brass Contributor
How To: Test image exists
I need to test to see if an image exists in a library. I am basing my code on the PNP JS documentation found here: https://pnp.github.io/pnpjs/sp/files/ This code works const file = sp.web.getFi...
Sudharsan K
May 31, 2020Iron Contributor
Hi, If you are aware of the extension of the file, try to use the getText or other methods on the file object. You can also check the file object to see whether the file exists or not.