Hi there.
I made a Web2py app. This app create pdf reports, which are opened by the Web Browser. The pdf files are saved in Download folder of the user. Is there any way to delete these files from Download directory? I tried several ways and I get
<class 'PermissionError'> [WinError 5] Denied access:in 'c:\\Users\\xxxxx\\Downloads' . The app runs behind IIS server.
The code i'm using in a controller is:
sistema = platform.system()
if sistema == "Windows":
rutaDescargas = Path(r"c:\Users\xxxx\Downloads")
archivosRecibos = rutaDescargas.glob("*.pdf")
for archivo in archivosRecibos:
os.remove(archivo)
xxx represents the name of user on compuer user
The app is running in a small office, in internal network, no Internet server.
Thanks.