Folder Contents


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Folder Contents
# 1  
Old 07-10-2003
Folder Contents

Hi,

I'm trying to allow people to access the contents of a folder on a web site, I am automatically placing files in this folder for people to download. I'm using Apache on Mac OS X, if that makes a difference.

Can anyone help with this? I've found no documentation on this so far...

Thanks!
# 2  
Old 07-10-2003
You just want to be able to let people view the files like they would in windows explorer?

You may have to adjust some security settings in apache, but try creating a folder in your website but don't place an html file in there that would load by default, such as index.html (or index.htm, default.html, etc - there should be a place in apache that lists all such files that apache will search for to load as a default page). I think if apache can't find any files in that list to load as a default page, then it will create a listing of all the files in the directory.
# 3  
Old 07-10-2003
Hi, thanks for the response!

Yes, I do want a file listing as you've stated. All I want to do is put TAB separated files in this folder and allow users to download by selecting them.I've already tried having a folder without HTML files, but simply get this error:


Forbidden
You don't have permission to access /reports/test/ on this server.

So, I presume I need to allow users to 'view folder contents' somehow...
# 4  
Old 07-10-2003
I don't know what you mean by TAB separated files. However, if you are satisfied with automatic directory listing that you see on typical Apache servers, then you have to check several things:

1) The directory config allows file listing. In httpd.conf make sure the concerned directory has "Indexes" in "Options". You may need to explicitly add a section to the config file to override the default, which is a very restrictive one.

e.g. try

<Directory "/reports/test">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

2) The directory has a chmod of 755 (don't know if MacOS needs this?)
# 5  
Old 07-11-2003
Hi, and thanks!

This worked perfectly. It's made me feel a little adventurous - is it possible to change the default file listing to reverse alphabetical order? I want to put some files on which I'll name by date, (yyyymmdd_filename.xxx) but want it to pick up the most recent first. I know users can just click the headers at the top to sort, I was just wondering if it's possible.

The files I'm putting on were tab separated exports from a database, but it just 'shows' them in the browser when saved as .tab - so I'm saving them as .xls (excel) so they are downloaded when clicked.

My understanding is that Mac OSX is effectively like a pretty GUI for UNIX, but commands like chmod are definitely relevant, there's only so much you can do without 'getting dirty' with the terminal. Also, I've found the front-end to be a little confusing.

Thanks again.
# 6  
Old 07-11-2003
About the directory listing, Apache has very little configuration to influence how the listing looks like. Fortunately, the IndexOrderDefault directive seems to do what you want.

For more configuration options, see also the IndexOptions directive. If you are not using 2.x, check the documentation of your version to see if these directives are applicable for your version.

I don't know much about MacOS (especially OS X). From your description and some little pre-OS X adventure I believe OS X is indeed a pretty form of Unix. Smilie But I would like to know whether MacOS X only runs on Mac? I didn't find the answer when it was released (last year?) and if not, I may be interested to have a look at it.
# 7  
Old 07-11-2003
It is Apache 2, that IndexOrderDefault looks good to me! Thanks for that.

I'm almost certain OS X will only run on a Mac. I've asked people about this and it seems to be the general consensus. I've found OS X to be more robust than previous Mac OS, and as it now embraces UNIX, it means I get some experience there.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Best way to move the contents of a folder to another one

what is the best way to move the contents of a folder to another one without deleting the structure of the first one. the contents could include subfolder too. both folder, the source-folder and the target-folder are on the same host. any idea is appreciated . (7 Replies)
Discussion started by: andy2000
7 Replies

2. Shell Programming and Scripting

Remove folder contents

for dir in BKP/*/ do echo You are in :$dir done O/P -- BKP/201448/ BKP/201449/ BKP/201450/ BKP/201451/ BKP/201452/ BKP/201501/ BKP/201502/ BKP/201503/ BKP/201504/ BKP/201505/ BKP/201506/ BKP/201507/ (3 Replies)
Discussion started by: rocking77
3 Replies

3. UNIX for Dummies Questions & Answers

Script that sums the contents of a folder (help me)

I'm looking for a script that sums the contents of a folder, When you give a parameter to the script , i want to know the size of the directory, the number of files, number of folders, These are commands that I have already found du -s find . -type f | wc -l find . -type d | wc -ly ... (19 Replies)
Discussion started by: Roggy
19 Replies

4. UNIX for Dummies Questions & Answers

Unable to list folder contents

I'm unable to list the contents of a directory once I move into it. I have full permissions on this directory (called "Scripts" in the below example). The scenario is shown below in detail: Command 'ls' works fine to begin with: 1: pmn@linuxhost /home/pmn > cd /opt/smt/proiv 2:... (4 Replies)
Discussion started by: pmn
4 Replies

5. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

6. Shell Programming and Scripting

copy folder and its contents to another folder

Hi experts, I am coming to you with this basic question on copying a folder and its content from one location to another folder using PERL script. This is my requirement. I have a folder AB under /users/myhome I want to copy AB and its contents to /user/workspace. Finally it should... (1 Reply)
Discussion started by: amvarma77
1 Replies

7. Shell Programming and Scripting

Script to create a folder with contents

I am working on HP Unix. Require a script for the below requirement. Requirement are: 1. Need to create a folder with files. 2. The folder should have a naming convention like - LRIC_ARCHIVE_ddmmyyhhmmss_version_nnn, the version number needs to be selected from an oracle table. 3. When the... (4 Replies)
Discussion started by: Roadies99
4 Replies

8. Shell Programming and Scripting

Compare folder contents over network

I use diff -r dir1 dir2 to get comparison of two folders that are on same machine. Now I need the same thing but one of the folders is on a different machine. Currently I ftp the folder to a temp folder compare using above command and delete the temp folder. Is there any other better options?... (5 Replies)
Discussion started by: ke3kelly
5 Replies

9. UNIX for Dummies Questions & Answers

How to display contents of folder when 'cd' is used

Hi, I am a new learner of Unix. I am currently working on a Solaris 8 machine. Earlier, when I use 'cd <folder name>' command, I am not only able to change the folder but also able to see the contents of the folder as if a 'ls -lt' command was executed. However, since a week, suddenly this... (3 Replies)
Discussion started by: mumashankar
3 Replies

10. UNIX for Dummies Questions & Answers

copy folder contents

I need to make a new dir in side the dir lab5 the new dir is called testLab5 without changing directories copy all files from your lab5 directory into your testLab5 directory then i have to without chaning directories and using exactly one command remove all files that start with the... (1 Reply)
Discussion started by: robsk8_99
1 Replies
Login or Register to Ask a Question