Log in or register to post comments
Last post
[Feature request] Overwrite without asking?
Heya, folks.

Is there any way to get CKFinder to automatically overwrite when it encounters an existing file with the same name?

Thanks,

- Dave.
Re: Overwrite without asking?
No, it is not possible now. You must delete file first and then upload it again. It would be rather not secure to allow this - for example if you have hundreds of files you could overwrite accidentally an important file.

Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

Re: Overwrite without asking?
Oh, I'm aware of the risks. Normally I wouldn't consider it, but I have a specific application in mind where overwriting without prompting would come in handy.
Re: Overwrite without asking?
I have a step-by-step set of notes on how I was able to get the overwrite working. If you are interested, please contact me. I added a check box so the user has to check the box before uploading... thus making it a 'little' bit safer. :)
Re: Overwrite without asking?
orgsauce wrote:I have a step-by-step set of notes on how I was able to get the overwrite working. If you are interested, please contact me. I added a check box so the user has to check the box before uploading... thus making it a 'little' bit safer. :)

I'd be interested if you could post that code, if you're still around here... thanks!
Re: Overwrite without asking?
Instructions for PHP:
Open ckfinder\core\connector\php\phpN\CommandHandler\FileUpload.php

After:
$sFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($sServerDir, $sFileName);


Add the following code:

            if (file_exists($sFilePath)) {
                @unlink($sFilePath);
                $thumbPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getThumbsServerPath(), $sFileName);
                @unlink($thumbPath);                
            }

Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

Re: [Feature request] Overwrite without asking?
Hi all, I want to ask if we can overwrite file but we send the notification before we execute
Re: [Feature request] Overwrite without asking?
Basically, you want to leave the decision whether the file should be overwritten to the user, is that correct?

Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

Re: [Feature request] Overwrite without asking?
No, what I mean is, I want to give the functionality to overwrite the file but, I want to send the notification to the user that user already upload the same file, then it will be overwritten, then user should choose yes or no.
Re: [Feature request] Overwrite without asking?
Can you post how I would make this change in Coldfusion and CKFinder 2.2.

Thank you