Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Wednesday, March 4, 2015 1:26:54 AM(UTC)

Rank: Newbie

Groups: Member
Joined: 2/4/2015(UTC)
Posts: 9

How to disable auto rename function when there is a same filename on server ?
I need to prompt user to rename his local file name when there is same filename on server.
How can I do it for php ? thanks!
#2 Posted : Wednesday, March 4, 2015 3:29:24 AM(UTC)

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Well, it requires quite tricky workflow:

1. First you send only filenames to the server. You can do it by setting a convertor to None.

2. On the server you check whether some of these names are already exist. If yes, send a list of files back (e.g. echo it as a comma separately list).

3. In the uploader you handle the AfterUpload event and parse the returned list. Display a user the message explaining that the particular files already exist.

4. After that you can restore file list and automatically remove duplicates from it. While the remaining files are being uploaded, they can go to the Windows Explorer and rename the appropriate files.

The similar approach is used in the Fail Safe Upload demo. Instead of file names it checks the hashes (i.e. compares the file content instead of file names), but you can modify it for file names instead.

Hope this makes sense.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.