Req #80372 [NEW]: Allow ZipArchive to open archive from string or at least data URL

From: Date: Sun, 15 Nov 2020 21:08:08 +0000
Subject: Req #80372 [NEW]: Allow ZipArchive to open archive from string or at least data URL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230373@lists.php.net to get a copy of this message
From:             michael dot vorisek at email dot cz
Operating system: 
PHP version:      7.4.12
Package:          Zip Related
Bug Type:         Feature/Change Request
Bug description:Allow ZipArchive to open archive from string or at least data URL

Description:
------------
ZipArchive does currently not allow to open archive from string not data
URL.

This is a feature request to allow ZipArchive to open archive from
string or at least data URL.

This is important as on RO filesystems zip archives can not be currently
opened and files like Excel can no be read.

Test script:
---------------
$dataAsUrl = $imageData = 'data:application/octet-stream;base64,' .
base64_encode($fileData);
$zip = new \ZipArchive();
$zip->open($dataAsUrl);

Expected result:
----------------
ZipArchive object can open/load data from string or from data URL.

Actual result:
--------------
<b>Warning</b>:  ZipArchive::open(): File name is longer than the
maximum allowed path length on this platform (4096):
data:application/octet-stream;base64,UEsDBBQABgAIAAA

-- 
Edit bug report at https://bugs.php.net/bug.php?id=80372&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80372&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80372&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80372&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80372&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80372&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80372&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80372&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80372&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80372&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80372&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80372&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80372&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80372&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80372&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80372&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80372&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80372&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#230373) next »