• Hi,

    First of all thank you very much for your plugin.

    I am trying to use your filter for renaming the files uploaded and I was wondering if we could use merge tags in it.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ovann86

    (@ovann86)

    Hey,

    For renaming uploaded files there is only a WordPress (PHP) filter – itsg_gf_ajaxupload_filename – no keywords but you should be able to use it to do a range of things. There’s an example in the FAQs page.

    Can you give an example of what you had in mind? I’ll see if it’s possible or if we can make it possible.

    I’m a bit reluctant to put the time in to create a setting to control this. A few others have asked the same thing, so perhaps it’s necessary. I just thought the file name is important as a user might be providing information in the name of the file that would be lost if you automatically rename it.

    • This reply was modified 8 years, 5 months ago by ovann86.
    Thread Starter woods81

    (@woods81)

    Hi,

    Thanks for your response.

    What I am trying to do is a bit complex. I want users to be able to upload several files but then I need to rename those files based on other fields (e.g. {first_name}-{last-name}-{sequencial-number}.jpg

    May I contact you to request a freelance job?

    Thanks.

    Plugin Author ovann86

    (@ovann86)

    Hey,

    I don’t have the time to do freelance work at the moment, but if you do find someone and they say the plugin needs to change I’m happy to implement changes that will benefit others.

    Now with using the keywords, I might be able to write something for you.

    I’m thinking the process would be:
    1. User fills out form, uploads fields
    2. Form is submitted
    3. Script runs now — during post-submit action, it …
    3.1. define base file name, e.g. {first_name}-{last-name}-{sequencial-number}
    3.2. for each ajaxupload field — rename file (and thumbnail) where it is stored on the server
    3.3. for each ajaxupload field — update fields to use new file name

    Would {first_name} and {last-name} be mandatory fields? What would happen if they are not provided?

    Thread Starter woods81

    (@woods81)

    Hi,

    Yeah the process would be like that more or less.

    The exactly base file name would be:
    {unique-sequential-number}-{first_name}-{last-name}-{user-number}{category-of-the-file}.jpeg

    All fields are mandatory and they are filled out by the user except for the sequential number. For that I am using another script that automatically gives a sequential number BUT it is only after the form is submitted so if you could run your script after submission and use the {sequential-number} merge tag would be awesome!

    Many thanks!

    Thread Starter woods81

    (@woods81)

    Hi,

    Any updates on this? Still not interested in accepting a freelance job?

    Thanks.

    Interesed me too

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using merge tags in file renaming’ is closed to new replies.