How to show file listing on webpage

lotuscha

Member
Messages
33
Reaction score
1
Points
8
I would like to upload a bunch of files to a folder and have a friend view a listing of the filenames by keying in the appropriate URL, for example

http://domainname.x10host.com/project_files

Is this a permissions thing or is it not possible to do?
 

spacresx

Community Advocate
Community Support
Messages
2,199
Reaction score
195
Points
63
exposing your files like your suggesting is a security risk.

And im not 100% sure,
but i dont think you can password protect folders on free accounts,
as password protecting folders would keep people out without password.
so id assume it would become a TOS issue if it was done.
but only support could answer that.

plus free accounts require that you have some form of index page.
such as index.htm , index.html , index.php for example,
so exposing your files without an index file may be problematic.
again, support could answer that more clearly.

there are CMS and other scripts though that permit saving some files
like images or documents and your friend could sign up to access the files.
then they would have a user login and password.

other users may be able to share ideas as well.
 

Anna

I am just me
Staff member
Messages
11,755
Reaction score
583
Points
113
Note that while it is doable, you can turn on directory listing by adding "Options +Indexes" on a separate line without the quotes in .htaccess, all files on your account must relate to your website, using our free services as storage and filesharing is prohibited by ToS.

May I suggest using something like dropbox for sharing files between you and your friend.
 

lotuscha

Member
Messages
33
Reaction score
1
Points
8
exposing your files like your suggesting is a security risk.

And im not 100% sure,
but i dont think you can password protect folders on free accounts,
as password protecting folders would keep people out without password.
so id assume it would become a TOS issue if it was done.
but only support could answer that.

plus free accounts require that you have some form of index page.
such as index.htm , index.html , index.php for example,
so exposing your files without an index file may be problematic.
again, support could answer that more clearly.

there are CMS and other scripts though that permit saving some files
like images or documents and your friend could sign up to access the files.
then they would have a user login and password.

other users may be able to share ideas as well.


thanks spacresx. I'm pretty certain that at one time 'directory listing' was the default display if there was no index.xxx file. At some point in time that seems to have changed.
 

lotuscha

Member
Messages
33
Reaction score
1
Points
8
Note that while it is doable, you can turn on directory listing by adding "Options +Indexes" on a separate line without the quotes in .htaccess, all files on your account must relate to your website, using our free services as storage and filesharing is prohibited by ToS.

May I suggest using something like dropbox for sharing files between you and your friend.

Anna, thanks for your reply. This isn't for file sharing, as in music/movies... just random files. I have created the .htaccess file and it works perfectly. I would also like to incorporate a .htpasswd file but I am unclear as to how to structure the AuthUserFile path which designates the location of the .htpasswd file.
 
Last edited:

karrx10h

Member
Messages
73
Reaction score
8
Points
8
What you're trying to do is pretty simple done with the control panel.

Go to the «File Manager». Browse to the directory/folder you want to protect. "Mouse-over" it and click «Protect». Fill-in the form. The ".htaccess" file in that directory will look kinda like this:
AuthGroupFile /dev/null
AuthUserFile /home/your_username/domains/your_domain/.htpasswd/public_html/your_protected_directory/.htpasswd
AuthName "Member's Area"
ErrorDocument 401 "Unauthorized Access"
require valid-user
AuthType Basic

Yes, the ".htpasswd" file is created "behind the stage" (see «AuthUserfile» field). Open it and you'll see.
 
Last edited:

lotuscha

Member
Messages
33
Reaction score
1
Points
8
What you're trying to do is pretty simple done with the control panel.

Go to the «File Manager». Browse to the directory/folder you want to protect. "Mouse-over" it and click «Protect». Fill-in the form. The ".htaccess" file in that directory will look kinda like this:


Yes, the ".htpasswd" file is created "behind the stage" (see «AuthUserfile» field). Open it and you'll see.


karrx10h, thanks for that; it worked like a charm!
 

spacresx

Community Advocate
Community Support
Messages
2,199
Reaction score
195
Points
63
@karrx10h and lotuscha
just a heads up, support stated :
all files on your account must relate to your website, using our free services as storage and file sharing is prohibited by ToS.
this does not only relate to music/movies, it means any files.

i would strongly suggest reading the Tos before using password protection.
 
Top