PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Alter Image Name upon Upload ?

  1. Hi,

    Is it possible to alter the names of images upon the user uploading them?
    I would like to make sure that each image (which gets added to a post), has the following name: username_categoryname_sequencenumber.jpg

    The username will be the user who uploaded the image, then the category for which the post is added too, and the sequence number would be between 1 and 10, as the user can upload between 1 and 10 images per time.

    Is this easily achievable or would it require some custom coding?

    Thanks

    Posted 12 years ago on Monday November 21, 2011 | Permalink
  2. Currently there is a hook for customizing the folder where uploads are stored, however there is not currently a hook to customize the name of the file that gets stored. We can look at adding this hook in a future release.

    Posted 12 years ago on Monday November 21, 2011 | Permalink
  3. There was a post recently from Alex who described the process for both renaming the file and changing the entry to reflect the newly named file. Maybe you can use that for now:

    http://www.gravityhelp.com/forums/topic/append-a-prefix-to-file-uploads#post-39657

    It will require some custom code in your theme's functions.php.

    Posted 12 years ago on Tuesday November 22, 2011 | Permalink