Skip to content

Developer notes

  1. analyze (POST, 500 files per call): reads the catalogue, changes nothing.
  2. start: creates a job. add (500 files per call): stores the confirmed files. Every product is checked again here; the browser only proposes.
  3. chunk: appends to var/kv_bulk_image_uploader/<job>/<item>.part. The size on disk is the truth: a wrong offset gets the real one back. The last part sends the file through fn_update_image_pairs().
  4. finish: completes products. close gives up files that never arrived.

Files of one product are sent one by one, so main image and positions need no locking. All writes use security_hash.

The extension must be jpg, jpeg, png, gif or webp, and fn_get_image_size() must accept the content. The stored name is rebuilt from the base name with [A-Za-z0-9_-] and the extension of the real image type, so shell.php.jpg is stored as shell-php.jpg and a renamed script is refused. Part files have no user-controlled name and live under var/.

Core functions only: fn_update_image_pairs() (hooks update_image_pairs_pre, update_image_pairs) and fn_delete_image_pair() (hook delete_image_pair). Storage backends, variation and common product sync, and other add-ons keep working. Changing the old main image to additional is a direct UPDATE ?:images_links, undone if the new image is refused.

Table Contents
?:kv_biu_jobs One row per upload: owner, company, mode, alt template, status
?:kv_biu_items One row per file: product, SKU, status (W waiting, D done, F failed, S skipped), role, pair, message key
?:kv_biu_products Per product in a job: old pairs, demoted main pair, next position

Tygh\Addons\KvBulkImageUploader: Matcher (names to products), Jobs (upload state, report, undo), Config (settings, licence gate).

Matcher applies fn_get_company_condition(), so a vendor or selected storefront sees only its own products. Vendor copies of common products are excluded (master_product_id = 0) when the Common products add-on is active.

Config::isOn() is checked on start, add and chunk.

No storefront output, no storefront code path.

Drops the three tables. var/kv_bulk_image_uploader/ holds only unfinished uploads and is emptied when a job closes.