Hi,
Currently CKFinder renames new file in case there is file with the same name. But I need to implement the following logic: during file upload if file with such name elready exists I'd like to prompt the user to replace the file or not.
For example: file img.jpg was uploaded previously, user tries to upload a new file with the same name (img.jpg).
CKFinder creates a new file img(1).jpg. But I want to create a confirmbox: "A file with the same name already exists. Do you want replace file?" And if user says yes, we should replace old img.jpg with new img.jpg.
I found a place where I can check if file already exists but I don't know how to create a Javascript prompt dialog. Right now I'm looking into
\ckfinder\core\connector\asp\CommandHandler\FileUpload.asp
Please advise.
Thanks
Currently CKFinder renames new file in case there is file with the same name. But I need to implement the following logic: during file upload if file with such name elready exists I'd like to prompt the user to replace the file or not.
For example: file img.jpg was uploaded previously, user tries to upload a new file with the same name (img.jpg).
CKFinder creates a new file img(1).jpg. But I want to create a confirmbox: "A file with the same name already exists. Do you want replace file?" And if user says yes, we should replace old img.jpg with new img.jpg.
I found a place where I can check if file already exists but I don't know how to create a Javascript prompt dialog. Right now I'm looking into
\ckfinder\core\connector\asp\CommandHandler\FileUpload.asp
Please advise.
Thanks
Re: Don't rename but replace exists file
Interesting idea. There was a similar request here: viewtopic.php?f=10&t=21848
I'd say it's a bit complicated to implement it on your own.
There is no way to say to the server "hold on with moving a file to the userfiles folder, let user decide what to do with the file name".
It means that you would have to make an extra ajax call:
1. Either to check first whether there will be a name conflict (in such case you need access to the uploaded file before it is actually sent to the server to know its name)
2. Or different approach (ask after upload): in case the user decides to overwrite the old file, you'd need to delete the old file that was supposed to be renamed and then rename previously uploaded file to the correct name.
Again, it might be currently a bit hard to make it using just the public API.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: Don't rename but replace exists file
Please advise how to implement this.
Thanks
Re: Don't rename but replace exists file
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Classic ASP
Hi,
How would be possible to do the changes for CKFinder with Classic ASP?
I am currently using the latest version of CKFiner with Classic ASP.
Regards,