Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //assumes form id 118
- add_action("gform_pre_submission_118", "change_filename");
- function change_filename($form){
- //note, the current filename is stored in the $_FILES object in an array named using the input field name
- //in my test, my upload field was field id 2, so it is input_2
- $uploaded_name = $_FILES["input_2"]["name"]; //get current filename, do something with it
- $uploaded_name = "mytest.txt"; //changing filename
- //replace name in files global
- $_FILES["input_2"]["name"] = $uploaded_name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement