Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,990
    Plugin Contributions
    109

    Default Re: Upload file extension being stripped from .jpeg files

    The field orders_products_attributes.products_options_values should be TEXT - is it? If not is it possible the value is just getting truncated?
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  2. #12
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Upload file extension being stripped from .jpeg files

    Quote Originally Posted by swguy View Post
    The field orders_products_attributes.products_options_values should be TEXT - is it? If not is it possible the value is just getting truncated?
    Yes it is text

  3. #13
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Upload file extension being stripped from .jpeg files

    Is the .jpeg file's filename equally wrong in the "files_uploaded" table?

    I suspect the issue may be occurring in this part of the code, in the shopping_cart.php class:
    Code:
                    if ($products_options_file->parse(TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i])) {
                      $products_image_extension = substr($products_options_file->filename, strrpos($products_options_file->filename, '.'));
                      if (zen_is_logged_in()) {
                        $db->Execute("INSERT INTO " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name) VALUES ('" . zen_session_id() . "', " . (int)$_SESSION['customer_id'] . ", '" . zen_db_input($products_options_file->filename) . "')");
                      } else {
                        $db->Execute("INSERT INTO " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name) VALUES ('" . zen_session_id() . "', '" . zen_db_input($products_options_file->filename) . "')");
                      }
                      $insert_id = $db->Insert_ID();
                      $real_ids[TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]] = $insert_id . ". " . $products_options_file->filename;
                      $products_options_file->set_filename("$insert_id" . $products_image_extension);
                      if (!($products_options_file->save())) {
                        break;
                      }
                    } else {
    The green lines are related to the files_uploaded table, hence my question above. If that table's entry is fine, then perhaps the issue is happening afterward.
    The red line is (I think) where the filename is "set" for the orders_products_attributes entry. But it's still puzzling about the symptom you're reporting.

    Do you have any attribute-related customizations/plugins installed?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Upload file extension being stripped from .jpeg files

    Quote Originally Posted by DrByte View Post
    Is the .jpeg file's filename equally wrong in the "files_uploaded" table?
    The filename in that table is VERY incorrect. This is one of the entries 3E8A14F3-629D-4A6A-ADCA-E0B795AABCFB.jpeg. All the others for this file extension are similar.

    There are no attribute related customiaztions or plugins.

  5. #15
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Upload file extension being stripped from .jpeg files

    I did a compare of shopping_cart.php to 1.5.7b. I did find one change
    PHP Code:
    // appears to confuse products priced by attributes
         
    if ($product->fields['product_is_always_free_shipping'] == '1' or $product->fields['products_virtual'] == '1') {
            
    $shipping_attributes_price zen_get_discount_calc($product->fields['products_id'], $attribute_price->fields['products_attributes_id'], 
           
    $attribute_price->fields['options_values_price'], $qty);
           
    //Set these variable to a numeric to eliminate warning debug logs - rb
           
    $freeShippingTotal intval($freeShippingTotal);
           
    $shipping_attributes_price intval($shipping_attributes_price);
           
    $freeShippingTotal += $shipping_attributes_price;
         } 

  6. #16
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Upload file extension being stripped from .jpeg files

    It seems I may have figured this out. The old database had not been converted from utf8 to utf8mb4. The config file was set to the utf8mb4 charset. I modified the config file to utf8 and tested with the .jpeg extension. It loaded the file and added to the tables correctly. I'll continue to monitor this and will update again if it breaks.

  7. #17
    Join Date
    Jul 2012
    Posts
    16,038
    Plugin Contributions
    17

    Default Re: Upload file extension being stripped from .jpeg files

    Quote Originally Posted by badarac View Post
    It seems I may have figured this out. The old database had not been converted from utf8 to utf8mb4. The config file was set to the utf8mb4 charset. I modified the config file to utf8 and tested with the .jpeg extension. It loaded the file and added to the tables correctly. I'll continue to monitor this and will update again if it breaks.
    Is this to also mean that haven't run the convert to utf8mb4 plugin to... well update/convert the database to utf8mb4?

    I mean will be interesting to see/know that the craziness no longer happens at all, but... :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #18
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Upload file extension being stripped from .jpeg files

    You would be 100% correct in saying that the conversion plugin was not run. OOPS!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v156 GET query string being stripped from url
    By badarac in forum General Questions
    Replies: 33
    Last Post: 20 Jan 2020, 10:34 PM
  2. v154 File Upload - Want users to be able to select Multiple Files
    By aws702 in forum General Questions
    Replies: 1
    Last Post: 28 Feb 2017, 07:57 PM
  3. File upload capability (1GB files)
    By hllight in forum General Questions
    Replies: 14
    Last Post: 1 Jun 2009, 03:11 PM
  4. My customers cannot upload files having uppercase letters in filename extension
    By Bostitch in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 17 Jun 2008, 03:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR