• Resolved francoc30

    (@francoc30)


    Hi Josie,
    I am trying to figure out how to setup an upload layout/webform for OCCC Open Challenge. As you know their filename requirement is quite specific. So my first approach is to create fields that would capture the data, like maker’s number, category and image number. Then I specified in Webform to replace filename with prefix: XX[~memnum][~cat][~imgnum]. cat and ingnum are option-list fields, so there is no problem. But the memnum is not, so this did not work.

    Next I tried using the full spec file name and no prefix attached, like XX011PD01. Upon upload, the filename was changed to XX011PD01_ with “_” added. This did not work either.

    Is there any way to suppress the “_” ? Or is there a better approach to deal with O3C filename requirements for image uploads?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Josie Stauffer

    (@joanne123)

    The underscore is added to make sure any extra digits added by wordpress to avoid duplicate filenames are visible, and to avoid totally numeric filenames. I could look into making it optional, but absolutely do not have time at the moment.

    There are so many legacy applications with complex file-naming rules like this, and entrywizard cannot support them all.

    Do you have the membership number stored in your wordpress database at all? e.g by a membership plugin? If you do (and it has the right number of digits) it should be accessible as a custom field in entrywizard ( see the file ewz-extra.txt that comes with entrywizard ).

    Othewise you would probably need to download the files and rename them. There are file renaming programs, or you could generate a spreadsheet with all the data needeed (from entrywizard plus your membership records), and from it generate a set of file renaming commands which you then run on a command line (DOS for windows or unix for mac).

    Or there may possibly be a plugin that can rename files on the server.

    Thread Starter francoc30

    (@francoc30)

    Thanks for the quick reply. Making the underscore optional will be great. It gives user more flexibility depending on their scenarios. Looking forward to its implementation in the future.

    I do use a membership plugin the addon of which allows custom fields. There is no documentation on how to retrieve custom field data. I have made an enquiry to see if they have function to do that. If there is such a function, I can follow your extra plugin instructions. Once it is installed, how do I actually incorporate it in the prefix for the filename. Say for example with membership_num, I already have a membership_num field in the layout, but it is not an option-list field so the number is not incorporated in the prefix as filename. Will the Extra plugin solve this?

    Yeah, changing filename will be my last resort. Currently I already use a script to do just that locally. I am hoping to improve my workflow with image upload.

    Plugin Author Josie Stauffer

    (@joanne123)

    Yes, when you have set up the ewz_extra plugin, your custom fields will be accessible as ~CD1, ~CD2, etc in the prefix — see the popup help beside the prefix item in any webform

    Thread Starter francoc30

    (@francoc30)

    Allright, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replacing file name on upload’ is closed to new replies.