On Friday, March 5, 2021 at 10:08:41 AM UTC-8 José Eloy wrote: > > 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. >
Browsers generally limit a page's direct access to the client file system as a security measure. You are not supposed to be able to put files in arbitrary places (to avoid malicious code downloads) or read files outside a special store (to avoid data harvesting of personal or proprietary data) or to delete files outside of the special store. You can change the disposition header to control whether a file (the PDF report, in your case) is to be saved or only displayed. (In the latter case, it's generally still possible for the user to choose to save the file.) /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/a9e9c9f1-b56b-4635-92a1-021030e27e1bn%40googlegroups.com.