f



List files from directory not in apache web directory

Hello everyone,

is it possible to list files from directory other than in apache web
directory?
my web folder is placed on c:/ and i put my files in windows directory
"d:/files/images/".
I want those files to be able to view in client browser. when i tested
using server computer it succeed. but from client computer i got
nothing.
I checked the html sources and the files is directly loaded from "d:/
files/images/file_name.jpg" and then i found out why computer client
could not load that files.

is there any other way to make it happened ?

thank you guys for any kind of help.

best regards.
0
froditus (2)
4/4/2008 9:17:06 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

3 Replies
795 Views

Similar Articles

[PageSpeed] 46

On Apr 4, 12:17 pm, froditus <frodi...@gmail.com> wrote:
> Hello everyone,
>
> is it possible to list files from directory other than in apache web
> directory?
> my web folder is placed on c:/ and i put my files in windows directory
> "d:/files/images/".
> I want those files to be able to view in client browser. when i tested
> using server computer it succeed. but from client computer i got
> nothing.
> I checked the html sources and the files is directly loaded from "d:/
> files/images/file_name.jpg" and then i found out why computer client
> could not load that files.
>
> is there any other way to make it happened ?
>
> thank you guys for any kind of help.
>
> best regards.

It will not be accessible from the client computer because apache
cannot interpret the path.
You should build a php script that gets a parameter, let's say
'file_name.jpg' and goes and fetches it and than outputs it (using
gd). The script should know the image folder, and not $_GET it,
because that might be a security risk.

Cheers,
George.
0
4/4/2008 9:41:24 AM
froditus wrote:
> Hello everyone,
> 
> is it possible to list files from directory other than in apache web
> directory?
> my web folder is placed on c:/ and i put my files in windows directory
> "d:/files/images/".
> I want those files to be able to view in client browser. when i tested
> using server computer it succeed. but from client computer i got
> nothing.
> I checked the html sources and the files is directly loaded from "d:/
> files/images/file_name.jpg" and then i found out why computer client
> could not load that files.
> 
> is there any other way to make it happened ?
> 
> thank you guys for any kind of help.
> 
> best regards.


html sources? post the code snippet on how you read the d:... directory.

I use something like this which creates a dropdown list of files in a 
specific directory not under the htdocs directory structure:
echo "<form method=post action=mydosomething.php>";
echo "<br><tr><select name=dlfile>";
         if ($mydir = @opendir("/my/dir/path"))
         {
                 while($filename = readdir($mydir))
//                if (eregi("^a_+[A-Za-z0-9_]+\.jpg", $filename))
                         echo "<option 
value=$filename>$filename</option><br>";
         }
         closedir($mydir);
         echo "</select><br><p>";

this submits to another php script that performs a specific tasks when 
selecting a filename.

Remember that the web server will need read and/or write privs depending 
on what you are doing with this.  I would in no way make this executable 
  by the web server.  Some OS's allow for explicitly being able to 
disable  executable while enabling read/write.
0
maustin (1437)
4/5/2008 6:15:58 PM
froditus wrote:
> Hello everyone,
> 
> is it possible to list files from directory other than in apache web
> directory?
> my web folder is placed on c:/ and i put my files in windows directory
> "d:/files/images/".
> I want those files to be able to view in client browser. when i tested
> using server computer it succeed. but from client computer i got
> nothing.
> I checked the html sources and the files is directly loaded from "d:/
> files/images/file_name.jpg" and then i found out why computer client
> could not load that files.
> 
> is there any other way to make it happened ?
> 
> thank you guys for any kind of help.
> 
> best regards.
> 

This isn't a PHP question - what you need to do is configure your server 
properly.  Try alt.apache.configuration.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
4/5/2008 7:20:54 PM
Reply:

Similar Artilces:

files, directories, files, directories
Hi folks, I've been trying to make a decision and it's driving me crazy. Is a directory a file or is a directory NOT a file but a node? Should I have A) public interface IFile { IFileName FileName; IContent GetContent(); } public interface IDirectory extends IFile { } or B) public interface INode { INodeName NodeName; } public interface IFile extends INode { IContent GetContent(); } public interface IDirectory extends INode { } Method A is nice cause IFile becomes the base "Node" type and you can use names like "IFileName" which sounds nice compared to "INodeName" and fits with the "FileSystem" moniker. A has the disadvantage that IDirectory has a GetContent() method which isn't bad but can be considered a bit weird. It probably wouldn't be too hard to make users think of everything as a file. Method B is nice cause IDirectory doesn't have GetContent() -- that honour belongs only to IFile. B is at a disadvantage when it comes to naming: everything becomes a "Node". INodeName sounds rude compared to IFileName. This method feels more "pure" cause you're specialising features completely. Do you reckon I can get away with Method A? It doesn't seem as pure unless you spend a long time convincing yourself that (for all intents and purposes) a file *is* a node (it's just got a different name) and a directory *is* a file. A penny for anyone's thought...

List of directories with a directory
I have a directory with 200 sub directories in it. How do I create a list of the sub directory names? I know how create a list of all the files in a directory: opendir(DIR, $dirname) or die "can't open $dirname: $!"; while (defined($file = readdir(DIR))) { next if($file =~ m/^\./); next if($file eq ""); push (@filenames, $file); } closedir(DIR); but how do I do it for the directories within a directory Al Moodie. On Tue, 29 Jan 2008 19:45:50 -0500, Al Moodie <nospam@nospam.com> wrote: >I have a directory with 200 sub directories in it. How do I create ...

Create PHP pages from list of files in directory
Hello, this is probably easy for a php pro... but I cant figure it out.. I have a directory of mp3 files named like this. Chevy_Car_Commercial.mp3 There are about 150 files. I am trying to find a script that will make php pages based on the file names. chevy_car_commercial.php And also dump that variable title Chevy Car Commercial into the <title> of the web page... I have made dynamic pages before... but that was using a form.. Anyone know if this is possible? Thanks kj kennyjjohnson@gmail.com wrote: > I am trying to find a script that will make php pages based on the > f...

How to only get a list of the names of the non-directory files in current directory ('.')?
How to only get a list of the names of the non-directory files in current directory ('.')? (Note excluding its subdirectories ). I need the code : ) On Tue, Nov 6, 2012 at 4:19 PM, iMath <redstone-cold@163.com> wrote: > How to only get a list of the names of the non-directory files in current directory ('.')? > (Note excluding its subdirectories ). > > I need the code : ) Start by getting a list of names of everything in the current directory. Then filter that list by testing each one to see if it's a directory. Tip: The second step can be done with os.path.isdir Put some code together and try it. If you have trouble, post your code, any exception traceback you get, and what you're having difficulty with, and we'll go on from there. Have fun! ChrisA =E5=9C=A8 2012=E5=B9=B411=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=8CUTC+= 8=E4=B8=8B=E5=8D=881=E6=97=B624=E5=88=8641=E7=A7=92=EF=BC=8CChris Angelico= =E5=86=99=E9=81=93=EF=BC=9A > On Tue, Nov 6, 2012 at 4:19 PM, iMath <redstone-cold@163.com> wrote: >=20 > > How to only get a list of the names of the non-directory files in curre= nt directory ('.')? >=20 > > (Note excluding its subdirectories ). >=20 > > >=20 > > I need the code : ) >=20 >=20 >=20 > Start by getting a list of names of everything in the current directory. >=20 >=20 >=20 > Then filter that li...

Getting all directories/files from current directory and using -d flag for the directories
Hi guys/gals, I'm pretty new to Perl, so please keep that in mind. :) It looks like File::Find goes through all the subdirectories of the current directory, which isn't what I want. I just want all the contents of the current directory. On doing some research, many people have recommended doing something like the following: ----------- $home_dir = ''; #changed to protect the innocent :) opendir(DIR,$home_dir) or die "Can't open the current directory: $home_dir $!\n"; # read file/directory names in that directory into @names @names = readdir(DIR) or die "...

Block Tomcat 5.5 Directory listing vulnerability with Apache <Directory>
Hi all, I have been trying to block the Tomcat directory listing vulnerability using Apache's Directory with no success. Has anyone been able to fix that? We can't upgrade Tomcat as recommended by the CVE, and that flaw is also present on versions above 5.5.17 Here is the vulnerability: http://www.securityfocus.com/bid/19106/exploit Basically any url like http://foo.com/; (with a semicolon at the end) displays the directory files This is what I'm trying to do: <Directory ~ "^\;"> AllowOverride None Order deny,allow Deny from all ...

How to separate directory list and file list?
With >glob.glob("*") or >os.listdir(cwd) I can get a combined file list with directory list, but I just wanna a bare file list, no directory list. How to get it? Tons of thanks in advance! Gonnasi Hi, 2005/10/23, Gonnasi <harddong@21cn.net>: > With > >glob.glob("*") > > or > >os.listdir(cwd) > > I can get a combined file list with directory list, but I just wanna a > bare file list, no directory list. How to get it? don't know if it is the best solution, but it looks nice. :) path =3D "/home/test" files =3D [fn...

sql for db2 list db directory and db2 list node directory
DB2 8.2.3 is there a sql equivalent to get the information provided by db2 list node directory db2 list db directory. thanks. No as this info is not contained in catalog tables. There migh be a proc in V8.2 or V9.1, a search in Google would reveal that. There's also a a command DB2CFEXP that extracts this info. Regards, Pierre. -- Pierre Saint-Jacques SES Consultants Inc. 514-737-4515 <dcruncher4@aim.com> a �crit dans le message de news: 1162911799.123033.210830@h48g2000cwc.googlegroups.com... > DB2 8.2.3 > > is there a sql equivalent to get the information provided by > > db2 list node directory > db2 list db directory. > > thanks. > ...

Delete a directory and all its files and sub-directories?
Hi, Does anyone know of, or have code that will delete a php directory and all its sub directories and files. "unlink" and "rmdir" don't do this. I'd prefer not to use "exec" with a system call but if that's the only way, so be it. I'm using PHP 4.4.4. Thanks, - Dave laredotornado@gmail.com said: > Does anyone know of, or have code that will delete a php directory and > all its sub directories and files. "unlink" and "rmdir" don't do this. > I'd prefer not to use "exec" with a system call but ...

list of files in directory and all subdirectories > files.csv
I've been given the tedious task of having to do a file inventory on our network drives. What I need to do is to get all of the files in a directory and all it's subdirectories into a CSV containing each file's name, size, path, and last modified date. The CSV would then be parsed into a spreadsheet or database for the boss to peruse and query at his leisure in an effort to find the files we can delete to save space. I'm pretty sure there's a shell script I can write to do this, but I'm at a loss as to how. Any help would be very appreciated. johnhutch@gmail.com w...

rename to txt file
I am trying to rename a file in my directory. I can see this file in directory. It has an extention of .dep, when I attempt to rename it, nothing gets renamed. When I output all filenames from the directory this particular file containing .dep is not on the list. I can see it is there, however this script doesn't pull it. Do you know what this might mean? require 'fileutils' require 'find' require 'ftools' require 'enumerator' #locate new .dep file and rename to txt file for later modification Dir.entries("C:/Diff").each do |filename| if File.e...

Directory and file listing
Hello, I am trying to write my first ruby script to be used with Sketchup. Basically it is the first part of the script that I am having a problem with. So here is what i am trying to do: 1: person imputs the directory path---ie c://program.../yada/ 2: ruby reads all image files in that directory and stores the file names in a string to be used later on. So I basically what the script to go into a directory and list all of the file names. Then I can use those file names to feed into the rest of my script. any help would be appreciated, thanks, Adam -- Posted via http://www.ruby-foru...

directory listing into file
Hi there! I'm trying to write the result of a "dir /b" command into a file. Just like this: dir/b C:\mydir > mydir.txt The directory contains files in and german, so some characters like �,�,.. are not properly written in the file, although they do by listing the directory without saving it into the file (dir/b C:\mydir) Has any of you any idea how could I solve this problem? Thanks Yeray Yeray Garcia wrote: > > Hi there! > > I'm trying to write the result of a "dir /b" command into a file. Just > like this: > > dir/b C:\mydir > mydir.txt > > The directory contains files in and german, so some characters like > �,�,.. are not properly written in the file, although they do by listing > the directory without saving it into the file (dir/b C:\mydir) Die Zeichen sind im MSDOS Format gespeichert, d.h. "type mydir.txt" oder �ffnen mit einem DOS Editor "edit mydir.txt" liefert auch die richtige Darstellung. Damit die Zeichen in einem Windows Programm richtig dargestellt werden ist folgende Ersetzung zu machen: � � � � � � � DOS 84 8E 94 99 81 9A E1 WIN E4 C4 F6 D6 FC DC DF Das kann z.B. mit WORD gemacht werden: Nach �ffnen der Datei "MSDOS-Text" ausw�hlen und dann als "Nur Text" speichern. Damit beim �ffnen das Auswahlmen� erscheint unter Extras -> Optionen -> Allgemein "Konvertierung beim �...

List of all files in directory
I wonder if there is an easy functional implementation for finding all files in a given directory, i.e. the equivalent of the Unix command: $ find <path> -type f For example: $ find . -type f ../a/1 ../a/2 ../a/3 ../a/a/1 ../a/a/2 ../a/a/3 ../a/b/1 ../a/c/1 ../a/c/2 ../a/c/3 ../b/1 ../b/2 ../b/3 (find-files #p"./") ==> (./a/1 ./a/2 ... ./b/3) Currently I use an imperative version what is sufficient for my application in mind (CDDB database), because it has only one directory level. System is CMUCL on Linux. ;; Is there a functional implementation with arbitrary d...

List of files from a directory
Dear All, I wuold like to import in a data structure in my workspace a list with all the filenames in a directory of my hard drive (even only the current directory wuold be fine). Does anybody know which command should I use? Or where I can find functions to interact with directories? Thanks for the help. Regards. Pasquale. "Pasquale Aliberti" <alibertipasquale@gmail.com> wrote in message <gku4q4$eig$1@fred.mathworks.com>... > Dear All, > > I wuold like to import in a data structure in my workspace a list with > all the filenames in a directory of my har...

Listing files in a directory
Hi. I have a problem with one my hp-ux machine. When I am in a directory and I try to get a list of the files in this directory, sometimes I get a list of few files instead of the complete list. I also see few directories. Here is an example: I'm in this directory: /Prestito/KTE I try to get the list of the content of this directory with the command "ll". In the list I have to see 3 directories (Acquisiti,Cancellati,DaAcquisire), but the command shows me only "DaAcquisire". I don't know why. I can't execute the command "cd Acquisiti" because the syste...

list files in directory
Hello Which class should i use to receive file names which are in specified directory ? Thanx Michal On Fri, 17 Dec 2004 09:29:21 +0100, vertigo wrote: > Hello > Which class should i use to receive file names which are in specified > directory ? > > Thanx > Michal Look at the following methods within java.io.File public String[] list(); public String[] list(FileNameFilter); public File[] listFiles(); public File[] listFiles(FileFilter); public File[] listFiles(FileNameFilter); HTH, La'ie Techie > Which class should i use to receive file names which are in specified > directory ? Look into java.io.File class. It can represent both file and directory. It's isFile() and isDirectory() methods tells you which one it is. Then its listFiles() method will return an array of File objects, which you can call various methods on to get the name, path, etc. Bookmark the Java API docs (http://java.sun.com/j2se/1.5.0/docs/api/) and refer to it often :) ...

listing files in a directory
I am trying to get a list of all files of a certain extension type on disk to do some processing in a loop. The code needs to be portable to UNIX, so I need to use plain C++ functionality. Does anyone know of a way to do this ? Any URLs, code snippets, etc ? Is this even possible ? David Jacques wrote: > > I am trying to get a list of all files of a certain extension type on disk > to do some processing in a loop. The code needs to be portable to UNIX, so > I need to use plain C++ functionality. Does anyone know of a way to do this > ? > Any URLs, code snippets, etc ? Is...

Script to move files with one occurence of a string to one directory, and other files to another directory?
I could use a script for the bash shell to look through a group of files (s= elected from one directory by a wildcard expression) and move any of those = files with exactly one occurrence of the string Path: to a different direct= ory, usually a subdirectory of the first directory. The rest of the files = selected by the wildcard expression are move to a third directory, also usu= ally a subdirectory of the first directory. I'm currently doing this manua= lly, but with grep commands to count the number of occurrences. NOT homework - I'm retired. Actually using Cygwin (an em...

listing sub directories of a directory using hla
Hi, i need to write a code in HLA, a part of which involves listing the contents of a directory ( i.e. its subdirectories and filecontents) . Any help in this regard will be appreciated. with best regards Prateek Gupta spamtrap@crayne.org wrote: > >i need to write a code in HLA, a part of which involves listing the >contents of a directory ( i.e. its subdirectories and filecontents) . >Any help in this regard will be appreciated. The key piece of information you did not tell us is what operating system you are targetting. The technique is VERY different for DOS, Win32, and Linu...

Files, directories and imports
Hello, group. I can only read files and import modules that are in the same directory as the one my script is. Here is a test script (path.py): import os import uno # some module I wrote print list(os.walk('~/hacking/python')) f = open('~/read/foo.txt') print f.read() And here is the output: Traceback (most recent call last): File "path.py", line 2, in <module> import uno ImportError: No module named uno If I comment that import, the output becomes this: [] Traceback (most recent call last): File "path.py", line 4, in <modu...

Re: Finding directory file of current directory
From: "R Boyd" <bob@hax.com> > Here's a command procedure I wrote years ago to handle the issue: [...] > See if that solves your problem. It probably will unless it encounters a contrary ODS5 extended file name: ALP $ show default LDA1:[o5_test.TEST2.a^[b^]c] ALP $ @ [--]uponedir.com PREV_DIR_LEV = "LDA1:[o5_test.TEST2]" CUR_DIR_SPEC = "LDA1:[o5_test.TEST2]a^[b^c].DIR" ALP $ dir [-]a*.dir Directory LDA1:[o5_test.TEST2] a^[b^]c.DIR;1 Total of 1 file. Everything's complicated. (And getting more so all the time.) From: JONE...

Konqueror saves file .directory in every directory
Konqueror saves file called ".directory" in every directory where I change some view properties of this directory, e.g. when clicking the "Detailed view" icon. I can see this behaviour on only one my machine/account with KDE, while it is working fine elsewhere. How can I disable this nasty file creation? BTW, someone knows how to use a web search engine (google, yahoo, ...) to search for ".directory"? They always strip the leading "." and thus giving out millions of useless results. Thanks, P.M. Quoth Petr Mikulik : > Konqueror saves file called ".directory" in every directory where I > change some view properties of this directory, e.g. when clicking the > "Detailed view" icon. I can see this behaviour on only one my > machine/account with KDE, while it is working fine elsewhere. How can > I disable this nasty file creation? Don't change any nasty properties and you won't create this nasty file. > BTW, someone knows how to use a web search engine (google, yahoo, ...) > to search for ".directory"? They always strip the leading "." and thus > giving out millions of useless results. Did you mean to ask, "Does someone know how to use a web search engine?" The answer is... yes, someone does. It's just not you. For instance, I would never start a search for "dumb questions about my operating system GUI" with the lone term "dum...

Specifying the Directory to List Box Directory Reader
To whom it may concern, I am using matlab 6.5 in order to implement a graphic user interface thru GUI. I have a problem concerning specifying the Directory to List Box Directory Reader, specifically how do I specify a directory different from Matlab directory using the function lbox2 of the Matlab tutorial, 'List Box Directory Reader'? I forwardly thank you for your help and time. Sincerely, Momo ...

Web resources about - List files from directory not in apache web directory - comp.lang.php

Wikipedia:Quick directory - Wikipedia, the free encyclopedia
This page is a handy directory to various locations of interest in Wikipedia. Only dynamic pages should be listed here, no policy pages etc. ...

Wikipedia:WikiProject Council/Directory - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Business Directory Listings: Eight Smart Tips for You to Get Started
If you are considering a business directory listing for your small business, congratulations – you are on the right track. Local SEO, local customers, ...

Atlas Partner Directory Launched
... just for Facebook and Instagram –advertising platform Atlas has one, as well. On that note, Atlas Tuesday introduced the Atlas Partner Directory ...

Slack announces App Directory store
... create more apps for the store, and a new framework called Botkit which should simplify the process of creating apps. The Slack App Directory, ...

Amazon brings Microsoft users into AWS with Active Directory service
Amazon has launched an AWS Directory Service for Active Directory , a fully managed implementation of Microsoft's authentication and user management ...

Security Recruiter Directory
To find the right security job or hire the right candidate, you first need to find the right recruiter. CSO's security recruiter directory is ...

Slack's App Directory proves it's more than just a chatroom
... are about to get a little easier to find and integrate within your team and over 160 of them live within the company's new Slack App Directory. ...

Resources last updated: 3/23/2016 6:30:00 PM