Ahmed Hossny
Ahmed Hossny

Reputation: 272

How Can I manage ftp so I make sure I replace another file?

I am creating a page to upload Images to FTP through a PHP page, I want to make sure that It saves the image with a name that doesn't exist in the same path. so all I need Is How to Upload a File then it should return the name that the image has saved with

Upvotes: 0

Views: 596

Answers (1)

CrayonViolent
CrayonViolent

Reputation: 32532

It saves it with the name you specify to save when you actually save it. If a file exists with the same name, it will not save it as a separate file, it will overwrite the existing file. If you want to avoid this, you need to first check if the file exists, and then pick a new name before saving it.

Upvotes: 1

Related Questions