Set folder Permissions (wodWebServer / wodWebServer.NET)
How do I set folder Permissions with wodWebServer.NET
How do I set folder Permissions with wodWebServer.NET
by wodDamir
, (6134 days ago) @ Brian Henry
Hi Brian,
Actually, you don't. Instead you would use RequestDone event to check which resource was requested by user. If the requested resource should be allowed, you send StatusCode 200 (OK).
If not, then you can send Forbidden or Unauthorized back to client.
Hope this helps.
Regards,
Damba
by Brian Henry
, (6134 days ago) @ wodDamir
Thanks I'll give it a try.
by Brian Henry
, (6134 days ago) @ Brian Henry
OK, I'm trying this code with no luck. I want to block access to a folder. Any help would be cool.
[code]
Private Sub web1_RequestDoneEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Server.WebRequestDoneArgs) Handles web1.RequestDoneEvent
If Args.Request.PageName = Test Then
Args.User.Response.StatusCode = WeOnlyDo.Server.StatusCodes.Unauthorized
Else
Args.User.Response.StatusCode = WeOnlyDo.Server.StatusCodes.OK
End If
End Sub
[/code]
by wodDamir
, (6133 days ago) @ Brian Henry
Brian,
Here is what I did in RequestDone event of our VB 2. Simple - manual response sample:
[code]Dim resp As String
If (Args.Request.PageName = index.htm ) Then
resp = <HTML><font face=Verdana size=2>Welcome visitor from
resp = resp & Args.User.RemoteIP & . This is <b>wodWebServer.NET</b>, version & web1.Version
resp = resp & <BR>You requested resource & Args.User.Request.Path & Args.User.Request.PageName
resp = resp & </font></HTML>
Args.User.Response.Body = resp
' don't forget to set status code and content type
Args.User.Response.Headers( Content-Type ).Value = text/html
Args.User.Response.StatusCode = WeOnlyDo.Server.StatusCodes.OK
Else
Args.User.CreateErrorResponse(404, Unauthorized , You aren't authorized to access the requested resource. )
End If[/code]
The above code shows the page if you enter http://127.0.0.1/index.htm in your browser. Otherwise it will display the error page saying that access is restricted.
Can you try the same?
Regards,
Damba
by Brian Henry
, (6133 days ago) @ wodDamir
Thanks, that works.

Your .NET components allow us to blend .NET technology seamlessly with secure communication, and with excellent technical support.

Your component works really great. With minor effort I have been able to convert my delphi application...

I can only hope I will have the pleasure to work with other products by "We Only Do" in the future.

Thank you very much for the rapid responses. I was a little nervous about dealing with a company that is on a different continent from me. You have proven my concerns to be unfounded.

...what I really like is that wodSSH and wodSFTP components work excellently and are constantly being improved...

...what I really like is that wodSSH and wodSFTP components work excellently and are constantly being improved...

...your service has been phenomenal. It's always quick and you are there when I need you.

It was no small factor, however, that your support in getting me up and running made me buy from you.

...your service has been phenomenal. It's always quick and you are there when I need you.

The people at WeOnlyDo are amazing! ... I always get a super fast response from customer service, and the products are great too. Thanks WeOnlyDo

