7 Replies - 564 Views - Last Post: 24 January 2018 - 02:10 PM

#1 Surprised?   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 24-January 18

I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 10:01 AM

Hi!
I am new, please be patient.
I want to be able to download only dll files through a C# program.

.htacces

SetEnvIfNoCase User-Agent "a" good_bot
<FilesMatch ".dll">
    Order Deny,Allow
    Deny from All
    Allow from env=good_bot
</FilesMatch>


Inside of program

wb.Headers.Add("User-Agent", "a");


Followed by some code which is fine, because it's downloading without that .htaccess on server.

But when I deploy that .htaccess, the client says 403 forbidden.

Is This A Good Question/Topic? 0
  • +

Replies To: I want to be able to download only dll files through a C# program. [

#2 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2791
  • View blog
  • Posts: 11,004
  • Joined: 03-December 12

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 10:09 AM

You need to understand htaccess rules. Read through this.
Allow Deny Rules


This also has nothing to do with C#. Moving to Hosting.
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6746
  • View blog
  • Posts: 31,224
  • Joined: 10-May 07

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 10:37 AM

View PostSurprised?, on 24 January 2018 - 12:01 PM, said:

I want to be able to download only dll files through a C# program.


I would filter the file type with your C#, & not with the webserver, that's not their intention.

To illuminate the 403, you could place the dll files in their own sub-directory. Then allow traffic to browse the directory, & when a dll file is selected it is downloaded. Again, if you already have a C# application for the client, I wouldn't filter this on the server side.
Was This Post Helpful? 0
  • +
  • -

#4 Surprised?   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 24-January 18

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 11:05 AM

View Postastonecipher, on 24 January 2018 - 10:09 AM, said:

You need to understand htaccess rules. Read through this.
Allow Deny Rules


This also has nothing to do with C#. Moving to Hosting.



    SetEnvIfNoCase User-Agent "a" good_bot
    <FilesMatch ".dll">
        Order Allow,Deny
        Allow from env=good_bot
    </FilesMatch>


This is what I was supposed to do? Still dosen't work..
Was This Post Helpful? 0
  • +
  • -

#5 Surprised?   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 24-January 18

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 11:16 AM

View Postno2pencil, on 24 January 2018 - 10:37 AM, said:

View PostSurprised?, on 24 January 2018 - 12:01 PM, said:

I want to be able to download only dll files through a C# program.


I would filter the file type with your C#, & not with the webserver, that's not their intention.

To illuminate the 403, you could place the dll files in their own sub-directory. Then allow traffic to browse the directory, & when a dll file is selected it is downloaded. Again, if you already have a C# application for the client, I wouldn't filter this on the server side.


I dont know what did i wrote..
I meant "I want to be able to download dll files only through a C# program.", not "I want to be able to download only dll files through a C# program."

Sorry..
Was This Post Helpful? 0
  • +
  • -

#6 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2791
  • View blog
  • Posts: 11,004
  • Joined: 03-December 12

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 01:23 PM

Until you figure out what you want to do, no one can help.

If your intent is to download dll's through a program, why are you using htaccess to restrict anything? Is it a file server? A Linux file server at that?
Was This Post Helpful? 0
  • +
  • -

#7 Surprised?   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 24-January 18

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 01:55 PM

View Postastonecipher, on 24 January 2018 - 01:23 PM, said:

Until you figure out what you want to do, no one can help.

If your intent is to download dll's through a program, why are you using htaccess to restrict anything? Is it a file server? A Linux file server at that?


I want to be able to download dll files only through a C# program, so no one can download it with url link.

Seems like .htacces is working, but this "CustomUserString", which is "a" dosent work..
Client says 403 forbidden, so it cant download it.
NO ONE CAN DOWNLOAD IT..
Was This Post Helpful? 0
  • +
  • -

#8 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2791
  • View blog
  • Posts: 11,004
  • Joined: 03-December 12

Re: I want to be able to download only dll files through a C# program. [

Posted 24 January 2018 - 02:10 PM

bot rules
Apache: The Definitive Guide

If the goal is to only allow certain people. You could go with IP, or a service that requires a valid token.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1