Prevent overwriting existing files when uploading files

You can share your Lua Scripts with everybody here.

Prevent overwriting existing files when uploading files

Postby FTP » Thu Aug 12, 2021 1:29 pm

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
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am

Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 2 guests