Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter("gform_upload_path", "change_upload_path", 20, 2);
- function change_upload_path($path_info, $form_id){
- $path_info["path"] = "/home/public_html/uploaded-files/";
- $path_info["url"] = "http://www.website.com/uploaded-files/";
- return $path_info;
- }
- add_action("gform_pre_submission_2", "pre_submission");
- function pre_submission($form){
- $new_file = $_FILES["input_26"];
- $updated_file = implode(",", $new_file);
- $updated_file = preg_replace('/^([^,]*).*$/', '$1', $updated_file);
- if ($updated_file == '') {
- } else {
- $_POST["input_31"] = 'http://www.website.com/uploaded-files/' . $updated_file;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement