473,763 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Apr 4 '08 #1
3 2625
On Apr 4, 12:17 pm, froditus <frodi...@gmail .comwrote:
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.
Apr 4 '08 #2
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=mydosome thing.php>";
echo "<br><tr><selec t 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.
Apr 5 '08 #3
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.conf iguration.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Apr 5 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11020
by: NotGiven | last post by:
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory...
1
2889
by: Titus Cheung | last post by:
Hello, Just installed Apache and PHP. Edited the .conf file for the appropariate addtype lines, and Apache itself is working. However, when I type in the URL for the test script, the browser behaves as if it is going to download the file and ask if I want to open, or save it. Any ideas of why this is happening? Thanks
3
20994
by: Harold Crump | last post by:
Greetings, I need to get a list of all files in a particular virtual directory on a web site, such as - http://www.myServer.com/FileStore I tried using the directory functions, but this doesn't work. if($dirHandle = opendir("http://www.myServer.com/FileStore/")) {
2
2612
by: Harold Ensle | last post by:
Has anyone ever had this problem? I have been compiling servlet files, correcting them, recompiling them and seeing the changes on the next URL request. So everything was going smoothly. Suddenly I could no longer change the .class files. That is, they were changed but the URL was apparently calling a cached version which would not update. When Apache was restarted, it would then finally update. Needless to say this is very undesirable...
1
7609
by: Joshua McCulloch | last post by:
I have setup Apache 2.0.50 and JBoss 3.2.5 using mod_jk2. My application is defined to operate in the root context (http://servername/) by creating a WEB-INF/jboss-web.xml I am serving static files (with apache) from a directory off the file system, by setting the DirectoryRoot variable in httpd.conf. JBoss is working off a .WAR built from this directory. Is there any way to reference the unarchived files from Apache?
9
1777
by: jab3 | last post by:
So I'm considering a small project that involves online file storage. Let's say I wanted to set up a site that allows people to log-on, create an account, and then have space to upload files. The problem I'm having concerns permissions, basically. 1) How do I automatically create users in Linux from a PHP script running under Apache's uid/gid? 2) Once 1 is done, how, when they log back on (authenticated with SQL which will keep up...
0
992
by: John | last post by:
Has anyone ever had this happen? I upgraded phpMyAdmin (2.9.0.3) and suddenly the php files no longer were processed by the php engine -- (Apache sends the php files as though they were a download). I checked my permissions, php.ini and httpd.conf, nothing strange there -- same as when it worked. I read UPDATING (I'm running FreeBSD 6.1-RELEASE, Apache 2.2.3, PHP 5.1.6_1, MySQL 5.0.24a) and nothing there on it. Checked the phpMyAdmin...
24
9874
by: Gary Hasler | last post by:
I want apache to parse all .html files for php code. Our 'real' web server is rented from ICDsoft ( php 5 on Apache on Linux whatever), and their instruction is to add the following to the .htaccess file: AddHandler application/x-httpd-php .html ....which works great. However, our local in-office server for testing and viewing our sites is Apache 2.0.55 with PHP 4.4.4 on Windows XP Pro. I have read everything I can find, and have...
2
5463
by: swethak | last post by:
hi, i have to get the gmail contact list using jsp code. For that purpose i have to use the Google data Api <%@ page import="com.xdatasystem.contactsimporter.*" %> <% // automatically guess the correct implementaion based on the email address ContactListImporter importer=ContactListImporterFactory.guess("mymail@gmail.com", "mypassword"); List<Contact> contacts=importer.getContactList();
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.