how to avoid duplicate filename in wordpress

As we all know wordpress stores your uploaded files (for me,it’s just JPG files) in a folder named “uploads” under “wp-content”. Files are separated into folders based on year and month.

Now i want to copy every file from every folder into a single folder on another server (for some purposes). I want to know, does wordpress rename duplicate files? is it possible that my files be overwritten on the new server?

Read More

If yes, how can i avoid this? is there a way to make wordpress rename files before storing them?

Related posts

Leave a Reply

2 comments

  1. You can scan your uploaded file folder and you have to options:
    1.- Set a random name for each file
    2.- Set a name convention including path and file name, for example: my_path_my_filename.jpg

    By the way your file wont be overwritten cause is another server

  2. This question seems about export/import…

    Check exported XML (WordPress eXtended RSS file format), you can download all media URLs at <wp:attachment_url> tag… Use any XML parser.

    Example without parser, at terminal:

      cat exportedSite.xml | grep wp:attachment_url
    

    will list all URLs. Each parsed URL can be downloaded by curl or wget.

    If you whant to restore the XML backup, change (only) the URLs of the wp:attachment_url tags by the new repo URLs