FTP upload & overwrite does NOT overwite, but creates [file.ext].# instead

8,646

There are several references to an "autorename" feature in pure-ftpd. Is it just a matter of turning it off? http://pureftpd.sourceforge.net/README

And while the file name descriptions make this seem less likely is the ftp client using the STOU option? http://www.nsftools.com/tips/RawFTP.htm

There may also be some help in this Q+A How do FTP servers handle rename to an existing file?

Share:
8,646

Related videos on Youtube

René Kåbis
Author by

René Kåbis

I am a long-standing geek, having been working with computers since 1982, on the Internet since 1989, on the Web since 1992, and in the I.T. industry since 1998. About the only major I.T. categories I haven’t touched upon in some way are those of 3D animation and building programs for the desktop. My current specialties include website development, website design (primarily PHP 5 and ASP.NET MVC), UI patterns and usability, security and general hardware. I am also reasonably proficient in networking and systems administration. I have an uncompleted (4th year) BSc (Bachelor of Science) in Physics and Mathematics and a completed BBA (Bachelor of Business Administration) in Accounting, Strategic Management and Leadership. I am also in the process of challenging most of the courses in a BCS (Bachelor of Computer Science). I am an advocate of constant learning, and do my best to remain open to constructive criticism at all times. The saying really is true - the more I learn, the more I realize how little I know.

Updated on September 18, 2022

Comments

  • René Kåbis
    René Kåbis over 1 year

    This question is a duplicate of one in StackOverflow, and I was recommended to ask this question here instead. My apologies if the multi-post is undesirable.

    I have a very strange issue with FTP that is bugging the living daylights out of me. This is the FIRST time I have ever seen this issue.

    When I upload a file, it does not overwrite the original, but instead gets renamed as [original file.ext].1 (or [file].2, if [file].1 already exists). For example, if style.css exist on the server, and I download and edit it, when I upload it back into position it gets “renamed” as style.css.1. Doing the attempt a second time produces a third file called style.css.2.

    I own my own iron, upon which I have OpenSUSE 11.4 64-bit installed (a relatively recent install, just configured). I am making use of pure-ftpd and use the YAST control panel to manipulate the settings. The Umask (umask files:umask dirs) setting in particular is set to 000:000 (the only setting which will give an uploaded file the same permissions as existing files). I have Chrooted ftp access for everyone, and in order for FTP to access /srv/www/, I have used the instructions on this site to mount /srv/www/ inside /home/[user]/ftp/ using the bind operation. Ergo, FTP access is chrooted for a very secure user, but the user still has access to content within /srv/www/.

    I have also taken the time to give the contents of /srv/www/ the same permissions and user:group as the user itself (i.e., there should be NO permissions issues).

    I am using WS_FTP Pro 2007 to access the site, as well as Notepad++ (via NppFTP), and both clients have the same problem: I can download files just fine, but when I upload them they have “.#” appended to them (.1, .2, .3, etc.) instead of overwriting the original file. These new files have the IDENTICAL permissions and ownership (user:group) as the original file, so I am totally in the dark as to why the upload creates a new file instead of overwriting.

    Edited to add: I have since tried several different FTP clients, including the FTP functionality in the Windows command line, with identical end results.

    • new123456
      new123456 over 12 years
      This is probably a common occurrence with FTP software - consider, for example, you had FTP access to important-file.txt, and some script kiddy broke in and overwrote it with a blank text file. My advice: write a cron job to rename any of these files, and run it every 5 minutes. Shouldn't be too difficult if you are semi-competent with shell scripts.
    • René Kåbis
      René Kåbis over 12 years
      @new123456 - I have run FTP servers on a number of boxes, prior to this setup of OpenSUSE 11.4. NONE of them have exhibited this particular behaviour. I would prefer to utilize a clean and elegant solution, not some cron-job hack.
  • René Kåbis
    René Kåbis over 12 years
    What I did (in my case) was to examine /etc/rc.d/pure-ftpd file, which contained within it a reference to /etc/pure-ftpd/pure-ftpd.conf. Within this second file, I found the entry AutoRename with a value of yes. I changed that to no, restarted pure-ftpd, and everything was running perfectly. Uploaded files do NOT get appended with a .# anymore. Thanks @Dennis, for the push in the right direction!