Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi–

    The plugin author addresses this with a filter, in the FAQ…here’s a code snippet:

    function my_itsg_gf_ajaxupload_filename( $name, $file_path, $size, $type, $error, $index, $content_range ) {
        $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : null; // get the field_id out of the post
        $file_extension = pathinfo( $name, PATHINFO_EXTENSION );  // get the file type out of the URL
        $name = 'FileOfField' . $field_id . '.' . $file_extension; // put it together
        return $name; // now return the new name
    }
    add_filter( 'itsg_gf_ajaxupload_filename', 'my_itsg_gf_ajaxupload_filename', 10, 7 );
    Plugin Author ovann86

    (@ovann86)

    Hey, What B said. You’ll have to use the itsg_gf_ajaxupload_filename filter – which I thought you asked for months ago?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rename Uploaded file’ is closed to new replies.