michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
337 stars 71 forks source link

Zip file access from windows #252

Closed mgibellini closed 7 years ago

mgibellini commented 8 years ago

I cannot Open Zip file on Windows.

I solved the problem adding this code:

ob_clean();

on line 34 of AdminPageFramework_Zip.php file

michaeluno commented 8 years ago

Hi,

I cannot confirm the problem in my environment. However, by searching the web for similar issues, it does not seem to be uncommon.

It could be that your server is printing some kind of an error message during the download process and causes the file to corrupt. Instead of modifying AdminPageFramework_Zip, can you try modifing the replyToDownloadFramework() method of the AdminPageFrameworkLoader_AdminPage_Tool_Generator_Generator class?

Around the line 252, change this

        header( "Content-Length: " . strlen( $_sData ) );
        unlink( $_sTempFile );

to

        unlink( $_sTempFile );   
        header( "Content-Length: " . strlen( $_sData ) );
        ob_clean();   
        flush();         

Let me know if this works.

michaeluno commented 7 years ago

Closing the topic due to inactivity.