Git Product home page Git Product logo

Comments (8)

Nanomani avatar Nanomani commented on August 21, 2024

I am not an expert but perhaps this can help you:

http://translate.google.com/translate?hl=&sl=fr&tl=en&u=http%3A%2F%2Fblog.nicolashachet.com%2F2011%2F12%2F28%2Fniveaux%2Fdebutant%2Fphp-zip-encoder-les-accents-dans-le-nom-des-fichiers-dune-archive-zip%2F

from pydio-core.

Nanomani avatar Nanomani commented on August 21, 2024

thanks to Falko for this link :-)

http://translate.google.com/translate?hl=&sl=de&tl=en&u=http%3A%2F%2Fwww.php.de%2Fphp-tipps-2009%2F59079-erledigt-php-ziparchive-generieren-und-umlaute-dateinamen.html&sandbox=1

from pydio-core.

cdujeu avatar cdujeu commented on August 21, 2024

so IBM850 or CP437 ???
@Ellega did you do some actual testings?

from pydio-core.

Nanomani avatar Nanomani commented on August 21, 2024

IBM850 and CP437 works. :-)

1 - test compress with Pydio

  • Put a file "été hivers éèêàâ.txt"
  • Compress with Pydio "été hivers éèêàâ.txt" => "été hivers éèêàâ.zip"
  • Download and read été hivers éèêàâ.zip
  • I see ÚtÚ hivers ÚÞÛÓÔ.txt in ZIP

2 - test with a very basic code (see below)

  • with IBM850 the file is correctly stored
  • with CP437 the file is correctly stored
  • with no ICONV the file is stored like with pydio

2014-01-09_123058

<?php
Echo "test ZIP".'<br><br>';

$zip = new ZipArchive (); 
$filename = "aaa.zip" ; 

Echo $filename.'<br><br>';

if ( $zip -> open ( $filename )=== TRUE ) 
{
    Echo "GOOD : file ZIP is present".'<br>';

    $zip -> addFile ( "été hivers éèêàâ.txt" , iconv ( "ISO-8859-1" , "IBM850" , "ICONV IBM850 - été hivers éèêàâ.txt" ));
    $zip -> addFile ( "été hivers éèêàâ.txt" , iconv ( "ISO-8859-1" , "CP437" , "ICONV CP437 - été hivers éèêàâ.txt" )); 
    $zip -> addFile ( "été hivers éèêàâ.txt" , "NOICONV - été hivers éèêàâ.txt" ); 
    $zip -> close (); 
}
else
{ 
    Echo "ERROR".'<br>';
    exit( "cannot open $filename \n" ); 
} 
?>

from pydio-core.

cdujeu avatar cdujeu commented on August 21, 2024

Can you try to patch the class plugins/access.fs/class.fsAccessDriver.php, at the very very end of the file, there is a function zipPreAddCallback, add the following line:

function zipPreAddCallback($value, &$header)
{
    if(fsAccessDriver::$filteringDriverInstance == null) return true;
// THIS LINE TO ADD
    $header["stored_filename"] = iconv("ISO-8859-1", "CP437", $header["stored_filename"]);
// END PATCH
    $search = $header["filename"];
    return !(fsAccessDriver::$filteringDriverInstance->filterFile($search)
        || fsAccessDriver::$filteringDriverInstance->filterFolder($search, "contains"));
}

from pydio-core.

Nanomani avatar Nanomani commented on August 21, 2024

This works perfectly with Pydio 5.0.4

I can't make a test with Pydio 5.1.x
Lot of things seems do not works with the last release and the access.fs if the files have an accent.

  • Delete, Compress don't work
  • rename, move are OK

I post more info about that in a new issue soon

(tested only with Pydio on Windows OS and Apache not with Linux)

from pydio-core.

cdujeu avatar cdujeu commented on August 21, 2024

cannot get it to work when server is on *nix platform (tested debian & macos)

from pydio-core.

cdujeu avatar cdujeu commented on August 21, 2024

mm, no actually, it seems to work on debian, when then opened on Windows. Problem is that the archive is then incorrect when opened on Mac. And that quote in file (') is breaking the name... F*cking zip :-)

from pydio-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.