How to rename file while uploading in Wordpress?

Use the function media_handle_upload() and described in the documentation a way to load the images.

How to rename file after upload to server?
Ie if I this way download file badName.png on the server, I get /wp-content/uploads/2016/05/badName.png and a bunch of his thumbnail. And you need to rename the file so that it is preserved as /wp-content/uploads/2016/05/goodName.png and sootvetstvenno all reduced copies too.
July 9th 19 at 13:19
1 answer
July 9th 19 at 13:21

Find more questions by tags WordPress