Gary 18 Posted December 17, 2021 Hello All, I am making some changes to an app that has been running for a little over 2 years. I have a MySQL DB with an attachments table that stores filenames, the actual files are in a shared folder on the same computer. The full path had been stored, now the path is in a settings table where it can be changed and only the filename in the attachments directory. To test it I have 2 computers with the database and attachments stored, the path in the settings table is of course different on each computer. All is well and I was ready to update it when I tried to run the client app from my laptop. All is well accessing one computer, but not on the other. When loading the form that deals with the files I do a check to make sure I have a valid directory DirectoryExists(AttachmentsDir), if not I show a message and close the window. This returns false for the second computer, it does work fine from my desktop. So it must be an access issue but I have tried the following with no joy: Confirm the laptop has access to the shared directory, I have a mapped drive that access it no problem, I can type the path just as it is passed to DirectoryExists into File Explorer and no problem there as well. I ran the program as administrator and still no access. The client has 4 users in it all day and a couple other occasional users, they have no problem with access currently, but I know that if this can happen here it WILL happen as soon as I update their copy. BTW the file server is a simple Windows 10 PC with a local network no outside access. Any ideas?? Thanks in advance Gary Share this post Link to post
Lars Fosdal 1793 Posted December 17, 2021 Is the second computer logged in with a different user? Does that user have access to the share? How are the files opened? Make sure you open them read only, deny none. If the files are opened in a third party tool, you might not have control over that. Using the SysInternals Process Monitor may offer insights to what it is that goes wrong. Share this post Link to post
Gary 18 Posted December 17, 2021 The second computer has only 1 user, yours truly. I can access the share no problem through an already existing mapped drive or just by typing the address into the file manager. So the computer\user has access. As I said I even tried starting the app as administrator. Most of the attachments are .pdf files, so I tried opening from my reader, no problem, even typing \\DellT310\users\public in the file open dialog will open the public directory. Why would the other app be restricted? The path has to be correct (no spelling errors) since it is read from the Database and the other computer accessing the same database has no problem?? Share this post Link to post
Gary 18 Posted December 17, 2021 Problem solved! Coming back to the laptop my BitDefender prompted me to turn the VPN back on, leaving it off everything is good, turn it on I get restricted. I went back to desktop, turned on VPN and it still connects. The Desktop is wired, the laptop is on wifi though. Why would only this app be blocked though? I can still access the folder with file manager and pdf reader with the VPN on. I thought, maybe the DirectoryExists() function could possibly be the problem, but commenting it out and letting the form load then selecting a file to open fails as well. I use ShellExecute to try to open the files with the users default app since the attachments can be different file types. No exceptions are raised, it just does nothing. Share this post Link to post
Gary 18 Posted December 17, 2021 More info.. Seems VPN not the problem. It is only blocked if I run from IDE. So app is fine running outside of Delphi, good enough for me. Share this post Link to post