473,766 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CHMOD help

Hello everyone, =]
I need your help,

I'm creating a script that will work in many servers, and there's this part,
where you can update a list, so the script goes from the client's machine to
the central server, opens the file, and in adda line by line in the client
server, it's all working fine, but there's a problem, this list, can't be
available to others, because if I do this:
www.test.com/list/test.txt

I can see the hole list, if I remove the permissions, my script wont work
anymore, what can I do ?

I've thought that I could chmod the file to 0777, make it a copy, and remove
the permission, so the file would't be available for others that just enter
the URL.
But it doesn't work at all, here's the error I get:
Warning: chmod(): Unable to access www.test.com/proxy/ in
/home/test/public_html/clicksentinel/form_classes.ph p on line 859

Warning: chmod(): No such file or directory in
/home/test/public_html/clicksentinel/form_classes.ph p on line 859
Sorry, try again later, error at data number5You have an error in your SQL
syntax. Check the manual that corresponds to your MySQL server version for
the right syntax to use near 't have permission to access
/proxy/proxylist.txt') ' at line 1
Please, I really need some help,

tks a lot

Freebird
Nov 10 '05 #1
2 2918
>I'm creating a script that will work in many servers, and there's this part,
where you can update a list, so the script goes from the client's machine to
the central server, opens the file, and in adda line by line in the client
server, it's all working fine, but there's a problem, this list, can't be
available to others, because if I do this:
www.test.com/list/test.txt
You pass an *ABSOLUTE FILE PATHNAME* to chmod. Not a URL.
I can see the hole list, if I remove the permissions, my script wont work
anymore, what can I do ?

I've thought that I could chmod the file to 0777, make it a copy, and remove
the permission, so the file would't be available for others that just enter
the URL.
If you're expecting security, this won't work, because as long as the
file has the permissions on, someone *could* fetch it.
But it doesn't work at all, here's the error I get:
Warning: chmod(): Unable to access www.test.com/proxy/ in
/home/test/public_html/clicksentinel/form_classes.ph p on line 859

Warning: chmod(): No such file or directory in
/home/test/public_html/clicksentinel/form_classes.ph p on line 859
Sorry, try again later, error at data number5You have an error in your SQL
syntax. Check the manual that corresponds to your MySQL server version for
the right syntax to use near 't have permission to access
/proxy/proxylist.txt') ' at line 1
You have a file with that long, complicated filename that includes
a bunch of newlines and the text of MySQL error messages in the name?
Please, I really need some help,


Output the file name before passing it to chmod(). Verify that it
is correct.

Gordon L. Burditt
Nov 10 '05 #2
"Freebird" <pe*****@hotmai l.com> wrote:

Hello everyone, =]
I need your help,

I'm creating a script that will work in many servers, and there's this part,
where you can update a list, so the script goes from the client's machine to
the central server, opens the file, and in adda line by line in the client
server, it's all working fine, but there's a problem, this list, can't be
available to others, because if I do this:

www.test.com/list/test.txt

I can see the hole list, if I remove the permissions, my script wont work
anymore, what can I do ?


Why don't you put the file in some other location, outside of the web site?

Barring that, you should be able to use a .htaccess file to make the file
invisible to browsers.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 11 '05 #3

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

Similar topics

5
16815
by: Daniel | last post by:
Hi, From what I read from the PHP manual, chmod on a Windows platform should have no effect, and that seems totally normal (unless someone on sourceforge has a windows port of that!). I create a directory on my Windows box, and set chmod 777 on it (that should be full access for everyone if my memory serves me correctly), but when I want to rmdir that directory, I get a permission denied message (I can delete contents from that...
6
6701
by: Ask Josephsen | last post by:
Hi NG If I write the following: <?php $file="myfile.JPG"; if ( getmyuid()==fileowner ( $file ) ) { chgrp ( $file, getmygid() ); chown ( $file, getmyuid() );
1
4698
by: Xuan Yuan | last post by:
I'm using Windows XP Professional and have no FTP installed. Instead, I use Command Promt. I need to CHMOD a PHP file, so I type "CHMOD 775 file-path",but get "'CHMOD'is not recognized as an internal or external command,operable program or batch file"!Is this because I spelled it wrong?Or is it the computer's problem?
4
4834
by: Ian N | last post by:
Hi i'm having a problem with file permissions of upload, they appear to be being set to only readable by the administrator, so anyone browsing the site gets a 403 forbidden error when they try and view the image. I've tried adding the following line: - chmod($uploadfile, 444); and also a few variations on it but to no avail.
5
9554
by: Stewart | last post by:
Hi, I'm working on a program in VC++ right now that needs to set file permissions of a given file to 766 (read/write/execute). Now I've found the _chmod() function in the API help docs, but that only caters for read/write. Is there ANY way of setting 766 to a file through C++ at all? Many thanks. Mike
1
2988
by: James Colannino | last post by:
Ok, so now I have a very interesting problem, this time related to os.chmod. I have the following in a text file: 0600. My script reads that number as a string and converts it to an integer for use with chmod. However, when I do this, instead of the rw------ permissions that I expect, I get ---x-wx--T. I tried placing 0600 directly in the command (chmod(filename, 0600)), and that worked as expected (I got rw------). So then I entered...
3
3769
by: webhead | last post by:
I have a web where users can upload photos, but they want to also be able to delete them. The directory can have chmod changes but it won't let me chmod the files and unlink them. I'm assuming it really is a chmod problem even though the error message is "no such file or directory", as I'm sure the name and path are right. Even my ftp program won't let me chmod the files, is this a safemode problem?
47
3325
by: frizzle | last post by:
Hi, I am at the base of an FTP thingy i'm building, and i noticed that it would only work if i chmod the folder 777, i thought to remember correctly that previously on another site chmod 744 was enough, now it isn't. Am i mistaking, and should it always be 777 ? And isn't a chmodded 777 folder much more vulnerable? Frizzle.
3
4767
by: Rik | last post by:
Hello, first of all, my provider sucks, newsserver is down for the #nth time now, offcourse when I have an urgent question.... So this will be me first time using Google Groups, forgive me if something goes wrong. The problem at hand: In a restricted area I let a user upload an image, no problem The image gets scaled down with imagecopyresampled(), and stored with imagejpeg($resized_img,'/path/to/target/image.jpg')
0
9571
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
10168
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
9959
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
9838
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
7381
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
6651
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();...
1
3929
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
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.