[Skip to main content](#vessel-content)

#   Product file upload fails on Joomla 6.1.3+ for ZIP files: "File not uploaded for

##

- **[JanDerhake](/forum/user/84345-janderhake "View JanDerhake's Profile")**
- [![JanDerhake's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/84345-janderhake "View JanDerhake's Profile") Topic Author
- [ Offline](/forum/user/84345-janderhake)

Less More

- Posts: 3
- Thank you received: 0
-
-

2 hours 19 minutes ago [\#100000783](#100000783) by [JanDerhake](/forum/user/84345-janderhake "View JanDerhake's Profile")  *[Product file upload fails on Joomla 6.1.3+ for ZIP files: "File not uploaded for](/forum/26-product-category-display/100000165-product-file-upload-fails-on-joomla-6-1-3-for-zip-files-file-not-uploaded-for#100000783 "-- HikaShop version -- : 6.8.2 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : all  Hello,  since Joomla 6.1.3 we can no longer upload ZIP files as product files (downloads) in the backend product edit page. We sell Joomla extensions, so our product files are ZIP packages that contain PHP files.  Environment: Joomla 6.2.0, HikaShop Business 6.8.2 (build of 2026-11-20), PHP 8.3. The code is the same in 6.5.2, 6.6.0 and 6.7.1.  Steps to reproduce: 1. Backend, edit a product, block &quot;Images and Files&quot;, files area. 2. Upload a small ZIP that contains PHP files (any Joomla extension package, e.g. 100 KB).  Result: - &quot;New file&quot; popup (link button, mode &quot;Upload file&quot;, then OK): the popup shows a Joomla error page:   Joomla&#92;Filesystem&#92;File::upload: File not uploaded for security reasons! - Upload button and drag &amp; drop: the progress bar turns red at &quot;100%&quot;, there is no error message, and the file is not added. The AJAX request (ctrl=upload&amp;task=upload) returns HTTP 500 with an HTML error page.  Cause: Since joomla/filesystem 4.2.x (Joomla 6.1.3), Joomla&#92;Filesystem&#92;File::upload() runs File::isSafeFile() unless the 4th parameter $allowUnsafe is true. For archives (zip, rar, tar, gz, tgz, bz2, tbz, jpa) isSafeFile() scans the whole content for &quot;.php&quot;, &quot;.pl&quot;, &quot;.py&quot; and similar strings. A ZIP with PHP files in it is always rejected, and a ZIP without PHP can be rejected by chance because the compressed data contains such a string.  HikaShop calls File::upload($src, $dest) without that parameter: - administrator/components/com&#95;hikashop/helpers/upload.php, lines 188 and 427 - administrator/components/com&#95;hikashop/classes/file.php, lines 106 and 207 - also controllers/plugins.php line 401 and helpers/import.php line 314  Why it worked before: Up to HikaShop 6.4.1 these calls were JFile::upload(...). That legacy class returns false for an &quot;unsafe&quot; file, so your fallback    if(!JFile::upload(...)) { if(!move&#95;uploaded&#95;file(...)) { ... } }  stored the file. Since 6.5.2 the calls use &#92;Joomla&#92;Filesystem&#92;File::upload(...), which throws a FilesystemException instead of returning false. The move&#95;uploaded&#95;file() fallback is never reached.  Suggested fix: 1. For product files (type &quot;file&quot;), call File::upload($src, $dest, false, true), or pass &#93; as 5th parameter so that archive contents are not scanned. The files go to the secure upload folder, are filtered by the HikaShop setting for allowed file extensions, and only backend users with product edit rights can upload. 2. Wrap the calls in try/catch, so that the fallback works again and the user gets a readable error message in the AJAX uploader instead of a red bar without text.  Current workaround on our side: upload the file by FTP to the secure upload folder and select it with the &quot;+&quot; button.  Thank you, Jan Derhake")* was created by *[JanDerhake](/forum/user/84345-janderhake "View JanDerhake's Profile")*

-- HikaShop version -- : 6.8.2
-- Joomla version -- : 6.2.0
-- PHP version -- : 8.3
-- Browser(s) name and version -- : all

Hello,

since Joomla 6.1.3 we can no longer upload ZIP files as product files (downloads) in the backend product edit page. We sell Joomla extensions, so our product files are ZIP packages that contain PHP files.

Environment: Joomla 6.2.0, HikaShop Business 6.8.2 (build of 2026-11-20), PHP 8.3. The code is the same in 6.5.2, 6.6.0 and 6.7.1.

Steps to reproduce:
1. Backend, edit a product, block "Images and Files", files area.
2. Upload a small ZIP that contains PHP files (any Joomla extension package, e.g. 100 KB).

Result:
- "New file" popup (link button, mode "Upload file", then OK): the popup shows a Joomla error page:
  Joomla\Filesystem\File::upload: File not uploaded for security reasons!
- Upload button and drag &amp; drop: the progress bar turns red at "100%", there is no error message, and the file is not added. The AJAX request (ctrl=upload&amp;task=upload) returns HTTP 500 with an HTML error page.

Cause:
Since joomla/filesystem 4.2.x (Joomla 6.1.3), Joomla\Filesystem\File::upload() runs File::isSafeFile() unless the 4th parameter $allowUnsafe is true. For archives (zip, rar, tar, gz, tgz, bz2, tbz, jpa) isSafeFile() scans the whole content for ".php", ".pl", ".py" and similar strings. A ZIP with PHP files in it is always rejected, and a ZIP without PHP can be rejected by chance because the compressed data contains such a string.

HikaShop calls File::upload($src, $dest) without that parameter:
- administrator/components/com_hikashop/helpers/upload.php, lines 188 and 427
- administrator/components/com_hikashop/classes/file.php, lines 106 and 207
- also controllers/plugins.php line 401 and helpers/import.php line 314

Why it worked before:
Up to HikaShop 6.4.1 these calls were JFile::upload(...). That legacy class returns false for an "unsafe" file, so your fallback

  if(!JFile::upload(...)) { if(!move_uploaded_file(...)) { ... } }

stored the file. Since 6.5.2 the calls use \Joomla\Filesystem\File::upload(...), which throws a FilesystemException instead of returning false. The move_uploaded_file() fallback is never reached.

Suggested fix:
1. For product files (type "file"), call File::upload($src, $dest, false, true), or pass ] as 5th parameter so that archive contents are not scanned. The files go to the secure upload folder, are filtered by the HikaShop setting for allowed file extensions, and only backend users with product edit rights can upload.
2. Wrap the calls in try/catch, so that the fallback works again and the user gets a readable error message in the AJAX uploader instead of a red bar without text.

Current workaround on our side: upload the file by FTP to the secure upload folder and select it with the "+" button.

Thank you,
Jan Derhake

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS8xMDAwMDAxNjUtcHJvZHVjdC1maWxlLXVwbG9hZC1mYWlscy1vbi1qb29tbGEtNi0xLTMtZm9yLXppcC1maWxlcy1maWxlLW5vdC11cGxvYWRlZC1mb3I/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.040 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
