{"issue":{"user":{"id":1010904,"login":"scottybe","url":"https://api.github.com/users/scottybe","gravatar_id":"8139ccd65419dace261b8abbb55b8e7c","avatar_url":"https://secure.gravatar.com/avatar/8139ccd65419dace261b8abbb55b8e7c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"milestone":null,"title":"automatically change name if duplicate file","created_at":"2011-11-29T22:47:51Z","labels":[],"updated_at":"2011-12-21T18:35:12Z","state":"open","id":2394695,"html_url":"https://github.com/blueimp/jQuery-File-Upload/issues/823","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I'd like to automatically change the name of the uploaded file (i.e. append an _1, _2, _3, etc.) if it already exists on the server. I think I see where the code were go, but how can I tell if the file already exists and the counter needs to be incremented OR if the file already exists and the the new file just needs to be appended?\r\n\r\nIn the php code, the variable $append_file is true if the file already exists and the size of the new file is less than the size of the file on the server, but won't that sometimes be true if the new file has the same as a file previously uploaded?\r\n\r\nThanks.","number":823,"url":"https://api.github.com/repos/blueimp/jQuery-File-Upload/issues/823","comments":2,"assignee":null},"comment":{"user":{"id":1010904,"login":"scottybe","url":"https://api.github.com/users/scottybe","gravatar_id":"8139ccd65419dace261b8abbb55b8e7c","avatar_url":"https://secure.gravatar.com/avatar/8139ccd65419dace261b8abbb55b8e7c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-21T18:35:12Z","updated_at":"2011-12-21T18:35:12Z","id":3237623,"body":"My saga slowly continues. The only place I really need to worry about duplicate file names is just before the move_uploaded_file($uploaded_file, $file_path) call, and change $file_path as needed if it already exists.","url":"https://api.github.com/repos/blueimp/jQuery-File-Upload/issues/comments/3237623"},"action":"created"}