473,729 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using "opendir" through a CGI script on Apache

Greetings all,

I'm trying to use the "opendir" command on Win32 in a CGI script. I'm
using Apache 2.0.48 for Win32.

The "openDir" command works from the CGI script when I try to open a
folder located on my local system. When I try to "openDir" a network
drive using the CGI script run through Apache, Apache gives me the
error: Can't openDir... However, when I run the CGI script in a DOS
window, the command works properly.

Is it possible to use "openDir" in a CGI script, run through Apache?
What do I need to do to get it to work, is it a permission thing with
the Apache user?

Any help would be greatly appreciated.

Cheers,

Alex.
Jul 19 '05 #1
2 3210
Alex wrote:
Is it possible to use "openDir" in a CGI script, run through
Apache?
Yes, of course.
What do I need to do to get it to work, is it a permission thing
with the Apache user?


It's safest to specify the full path to the directory.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #2
Thanks for the post, I figured it out in the end...

Apache 2 runs as a service in Win32. The apache2 service runs as the
default system user which doesn't have any network permissions at all.
The best thing to do is to set up a new user with the domain
permissions you need, and get the service to log on as that user.
Drat, should have figured it out sooner!!!

...xelA


Gunnar Hjalmarsson <no*****@gunnar .cc> wrote in message news:<OX******* *************@n ewsc.telia.net> ...
Alex wrote:
Is it possible to use "openDir" in a CGI script, run through
Apache?


Yes, of course.
What do I need to do to get it to work, is it a permission thing
with the Apache user?


It's safest to specify the full path to the directory.

Jul 19 '05 #3

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

Similar topics

2
3735
by: opt_inf_env | last post by:
Hallo, I want to see from php-file list of files which are in directory, where is the given php-file. To do so, I put in the php-file the following line: <?php $sys = system("ls") ?> Then I would like to work with string $sys. However, in the place where the "system()" is executed, php-file print on screen result of the
2
16097
by: Andrew | last post by:
I'm trying to learn how to use the opendir() function with perl, and each time I try to run my perl script I keep getting "Permission denied". Here is the script: open (DIR, "c:\\Temp\\Directory1") or die "Can't open the directory. $! \n"; while (defined ($filename = readdir(DIR)) ) { open (INPUT, "<c:\\Temp\\directory1\\".$filename) or die "Can't open the
1
6912
by: Bob Gervais | last post by:
Hi, I am writing a very simple script that should return all subdirectories on a given path (non recursively, so just first level). This is the sub that I have for doing this but it gives very strange results: sub FindFiles {
2
8925
by: Matt | last post by:
Hello, I am writing a script that opens needs to get a listing of files in a directory, print that listing to a file and use that file as a quasi ftp control file. My problem is that when I print the filenames found via the readdir I also get the . and .. (current directory and parent directory) written in the ftp control file which causes my script to stop since you can't ftp . nor .. Here's my logic ....
4
3329
by: gnah | last post by:
Greetings, I hope my problem is easy to fix, I'm pretty new with php - but I am getting weird results with the opendir() function. It may just be a path problem, but I don't see which variable to change. here are some tests I did to see what was wrong: $blah = opendir("blocks"); while ($file = readdir($blah)) {
12
1759
by: Chad | last post by:
On page 180 from the 2nd edition of "The C Programming Language" by Kernighan and Richtie, they use the following: #define NAME_MAX 14 typedef struct { long ino; char name; } Dirent;
0
1686
by: Dave Klingler | last post by:
I've been trying to bring up an IMP webmail server for...oh, several days now. I've never had so much trouble bringing up any machine, and I've beaten my forehead flat against it. Either I've been at it too long, or I've been at it too long and there's a bug here somewhere. Basically, I had a working machine up until yesterday, with gd.so, imap.so, ldap.so, mbstring.so, mcrypt.so, and pgsql.so all up and running nicely. At that point...
9
2003
by: Synapse Syndrome | last post by:
Hi I've been given what I am told is a PHP script to be used on my server. I do not know any PHP. I am trying to use a feature of a program called ArchiCAD. This feauture allows CAD drawing files to be published on a webpage, and viewed and commented on using a java applet. The problem is that with ArchiCAD v10, it now makes spaces and uses other
1
1654
by: Oliver Marshall | last post by:
Hi, Im after a simple script to help sort my downloads. Basically I have a downloads folder, and at the moment I have directory browsing enabled so that i can download files. What I want is to have a php script (index.php) that will parse the files that it finds in downloads and create a nice page (using my template and css). If it finds a directory in /downloads, then it
0
8913
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6016
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
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
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
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.