Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4114888
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:30:44+00:00 2026-05-20T22:30:44+00:00

In a folder say /folderX/ there are 4 .txt files. A php script currently

  • 0

In a folder say /folderX/ there are 4 .txt files.
A php script currently makes new files if unexistend, based on the site.org/foo/ of the url it updates a new file if foo.txt does not exist, then it will go ahead and create it.

But I would wish to:
A) If the existing file is already in the folder, then allow it to update/rewrite it BUT
B) If the file is non existing e.g. foo.txt, then DONT allow it to create any more new files in folder /folderX/

Reason is that search engines sometimes accidentally check folders like /images/ or /icons/ or /articles/ etc and all those files become then created and PHP goes processing them. If the file cannot be made, then probably PHP will not process them and give them strange crawlers the error they deserve to see.

What properties should I set in the FTP folder folderX, to overule any PHP scripts and cause a disallowance of creation of any further new files in that folder?

Essentially I hop that a particular CHMOD will make this possible.
Thanks very much for your suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:30:45+00:00Added an answer on May 20, 2026 at 10:30 pm

    If all the files are created, then you can set the permisson 555 on the folder to remove the write flag for other users (webserver and PHP) and owner on directory entries. The files within will retain the rw- flag and thus still be writable.

    Note that this only works if no PHP script deletes any of the fileX.txt entries. Once unliked the write permissions are gone.

    (Btw, you could also use the permission 111 on the folder to even disallow listing of contents within that folder. More sneaky. But there’s probably no need.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
Say I have all these files in a folder: something(34324).php something(34).php something(3433454546).php something(65565).php something(9887).php
If I have a path for a given file, say 'C:\Folder\OtherFolder\AnotherFolder\file.txt' , is there
Let's say I have a folder on my desktop with the following files: file_c.txt
I have a folder (say /data) with a set of files say: a.txt, b.bin,
Say there is a folder, '/home/user/temp/a40bd22344'. The name is completely random and changes in
Lets say i got millions of files seperated into subfolders in a folder and
We can put our file say one.txt in txt folder available in tomcat->webapp folder.
I have two source files created in unix folder say file1.dat and file2.dat. I
I have an existing file on disk (say /folder/file.txt) and a FileField model field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.