Forum Discussion
Meismart
8 years agoCreator III
Hi Angela,
On the live server all the files are present and can be accessed, on the test server the vault was not copied across. This means I can only delete files that have been added to the test server.
I want to test a piece of code that deletes a file, but if the file is not present I get an an exception after the code has run. It appears that the File has an onBeforeDelete event that runs an internal method. This runs after the file meta-data has been deleted, ie try{} catch{} does not catch the exception.
Thus I want to be able to detect if the file is present before trying to delete it
I have read that I can use request - response to detect if a file exists at a URL, but I don't know how to get the URL to check. I have tried to copy the link, but the page always succeeds as this takes me to the ARAS Log-in page.
see msdn.microsoft.com/.../system.net.httpwebrequest.getresponse(v=vs.110).aspx