B4J Question [abmaterial]How to configure file permissions

liulifeng77

Active Member
Licensed User
Longtime User
I stored my connectionstring(ms sqlserver) in a text file.
but the text file can be opened in the browser!
how to prevent it!
thanks!
 

Attachments

  • 1.PNG
    1.PNG
    22.2 KB · Views: 234

alwaysbusy

Expert
Licensed User
Longtime User
Have you set dirAllowed to false in StartServer?

B4X:
#If RELEASE
     srvr.SetStaticFilesOptions(CreateMap("cacheControl": "max-age=604800,public","gzip":True,"dirAllowed":False))
   #Else
     srvr.SetStaticFilesOptions(CreateMap("cacheControl": "max-age=604800,public","gzip":False,"dirAllowed":False))
   #End If

If you did, then someone would have to 'guess' what your file is called to be able to open it. So maybe call it something one cannot guess that easy? like '24J4b7Q4M6kS.config'
 
Upvote 0
Top