• On the registration form, if two file or image upload fields are included and a new user (with iPhone 6 or similar) uses their camera to upload images both files will have the same name (iOS 10 and other case is “image.jpg”) and the second file uploaded will overwrite the first file uploaded.

    Included is a patch I used to fix this issue, so that the uploaded file name is associated with the input box ID field. Applies to 1.3.78, 1.3.79, and 1.3.80.

    Best regards
    jim

    --- ultimate-member/core/lib/upload/um-file-upload.php  2016-12-08 11:09:12.000000000 -0700
    +++ wp-content/plugins/ultimate-member/core/lib/upload/um-file-upload.php      2017-01-18 13:29:36.765290581 -0700
    @@ -38,7 +38,7 @@
         if(!is_array($_FILES[$id]['name'])) {
     
                    $temp = $_FILES[$id]["tmp_name"];
    -               $file = $_FILES[$id]["name"];
    +               $file = $id."-".$_FILES[$id]["name"];
                    $file = sanitize_file_name($file);
                    $extension = strtolower( pathinfo($file, PATHINFO_EXTENSION) );
     
    diff -ruN ultimate-member/core/lib/upload/um-image-upload.php wp-content/plugins/ultimate-member/core/lib/upload/um-image-upload.php
    --- ultimate-member/core/lib/upload/um-image-upload.php 2016-12-08 11:09:12.000000000 -0700
    +++ wp-content/plugins/ultimate-member/core/lib/upload/um-image-upload.php     2017-01-18 11:33:21.804886454 -0700
    @@ -35,7 +35,7 @@
         if(!is_array($_FILES[$id]['name'])) {
     
                    $temp = $_FILES[$id]["tmp_name"];
    -               $file = $_FILES[$id]["name"];
    +               $file = $id."-".$_FILES[$id]["name"];
                    $file = sanitize_file_name($file);
                     $ext = strtolower( pathinfo($file, PATHINFO_EXTENSION) );
     
    
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ultimate Member File/Image upload name conflict’ is closed to new replies.