Automatic plugin update gives error: Incompatible Archive. PCLZIP_ERR_BAD_FORMAT
-
Hi,
i’m trying to authenticate users before they can update..
now the problem is in my script i have the following:$file = 'myfile.zip'; header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file);
but it when i update.. it gives me this error:
Unpacking the update…Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
The archive itself is not corrupt.. i checked that by unpacking it on my local drive and it works fine..
My automatic update url is something like https://domain.com/update.php?name=…&pass=… and then if this it correct it executes the code i posted above..
I also tried to simply redirect them to the script with header(‘location: tomyzip’); but it gives the same error!
Any ideas how i can pass the file correctly??? Because when i just put the update url as https://domain.com/myfile.zip it works fine..
btw the reason that i do this is that i don’t want it that people can see the location of the zip file! Because on update it always say.. Downloading update from URL and i don’t want it.. else they can easily access it and download it manually..
Thanks in advance
- The topic ‘Automatic plugin update gives error: Incompatible Archive. PCLZIP_ERR_BAD_FORMAT’ is closed to new replies.