755 questions
Best practices
0
votes
1
replies
122
views
Best approach for handling large file uploads and ZIP generation in Laravel?
I’m building a Laravel 12 folder organizer where users may upload large folders (many files / large sizes), and I categorize files by extension and generate a ZIP for download.
Current approach:
...
1
vote
0
answers
60
views
How do I use php to add custom properties to docx
I am trying to prepare a docx template file with pre-inserted custom properties (Quick Part -> Fields) from a database. The file starts as an empty docx file created in MS Word.
I reviewed this ...
0
votes
0
answers
37
views
Zip a directory with subfolders and files without including parent directories in the zipped file [duplicate]
Before coming here, I've been looking for other topics and tested the provided answers and I'm still getting the same result.
So first of all, I have this folder structure.
uploads/
- student-records
-...
0
votes
2
answers
101
views
PHP: Unable to extact files from a ZIP archive
I am trying to upload a .zip file to a Server and extract it.
First, I move the uploaded .zip file to my $target_path
$target_Path = $path . basename($_FILES['file']['name']);
move_uploaded_file($...
0
votes
1
answer
48
views
How to get name of zip file [php] [ziparchive]
Given a ZipArchive, how is it possible to get the name of the file that is opened?
Let's say I have library function (which I can't edit) and it looks like this
function getZipFile(): ZipArchive
{
...
0
votes
0
answers
52
views
Can't open the extracted file using Laravel ZipArchive
In the system, there's a export capability where the user can export multiple files. We decided to put all the multiple files into zip folder.
We used the ZipArchive, so far what we have: export the ...
1
vote
0
answers
32
views
Call fsync on ZipArchive in PHP
Is there anyway to get access to underlying stream used by a ZipArchive in php so that fsync can be called on it?
I am looking to explicitly flush an archive I am creating to NFS to force propagation.
0
votes
2
answers
319
views
Class "ZipArchive" not found in web application [duplicate]
I am facing a strange issue in the interaction between a view and ZipArchive in laravel. I made some test class to test the issue:
<?php
namespace App\Services;
use ZipArchive;
class Test
{
...
-1
votes
1
answer
102
views
Does ZipArchive::addFile() mess with hrtime()?
I have this loop:
//open archive $zip
$start = hrtime(true);
while(true) {
$zip->addFile($files[$i++]);
$end = hrtime(true);
$time = ($end - $start) / 1e+9; // convert to seconds
if( $time &...
1
vote
2
answers
111
views
Set directory mtime in ZipArchive with PHP 7.4
In PHP 7.4, neither ZipArchive::setMtimeIndex nor ZipArchive::setMtimeName is available.
When creating Zip archives from files in PHP 7.4; files' mtime and permissions are applied to the corresponding ...
0
votes
0
answers
41
views
Is there any file limit in php ZipArchive?
I have the following problem, I have an array with several Amazon S3 links referring to .xml files.
I then pass these files through a forach and place them using php's ZipArchive addFromString.
The ...
1
vote
1
answer
978
views
problem with Warning: PHP Startup: Unable to load dynamic library 'zip'
I´m trying to update my composer in my proyect and command return this message:
PHP Warning: PHP Startup: Unable to load dynamic library 'php_zip.dll' (tried: C:/xampp/php/ext/php_zip.dll (No se ...
1
vote
1
answer
258
views
Php, ZipArchive deletes an empty file?
here is a little code I wrote:
file_put_contents('a.upl', '');
try
{
$x = new \ZipArchive();
$x->open('a.upl');
}
catch(\Exception $e)
{
echo $e->getMessage();
}
it throws a ...
2
votes
2
answers
294
views
PHP unzip deflate64
I am currently facing an issue while trying to decompress a ZIP file that utilizes Deflate64 compression in PHP using the ZipArchive class. The extraction process seems to be working well for regular ...
1
vote
2
answers
344
views
How to enable php-zip in laravel nativephp application
I am using Laravel nativePHP package to generate desktop application
It's running fine but when I try to generate zip file with ZipArchive class, getting this error : Class "ZipArchive" not ...