Prevent overwriting existing files when uploading files

You can share your Lua Scripts with everybody here.
Post Reply
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Prevent overwriting existing files when uploading files

Post by FTP »

If server side exists a file "example.doc", and you try to upload a file with the same name "example.doc", then your uploaded file will overwrite the old one, so how to prevent it? You just need a simple Lua script for the FTP/SSH/HTTP event "BeforeFileUploaded":

Code: Select all

if c_FileExist("%PathName") == true then
  bCancelEvent = true
end
Image
Post Reply