Le 04/04/2012 18:38, Chris Allen a écrit :
Don't know why or where, but you've got some utf8 encoding going on.
EF,BF,BD is the utf8 "replacement string" used for an unknown character 
(probably the initial FF).

Suggest you sniff your data stream to see if it's happening before it reaches 
Embperl.

tcpdump prints this :

        0x0500:  7570 6c33 3831 223b 2066 696c 656e 616d  upl381";.filenam
        0x0510:  653d 2243 686f 7269 7374 6573 4844 312e  e="ChoristesHD1.
        0x0520:  6a70 6722 0d0a 436f 6e74 656e 742d 5479  jpg"..Content-Ty
        0x0530:  7065 3a20 696d 6167 652f 6a70 6567 0d0a  pe:.image/jpeg..
        0x0540:  0d0a ffd8 ffe0 0010 4a46 4946 0001 0101  ........JFIF....
        0x0550:  012c 012c 0000 ffe1 33ff 4578 6966 0000  .,.,....3.Exif..

So it has to be embperl-related.

The site's config seems clean to me :

<VirtualHost *>
        ServerName something.fr
        DocumentRoot /var/www/sites/semi
        DirectoryIndex index.html
        EMBPERL_DEBUG     0
        EMBPERL_APPNAME semiv2
        EMBPERL_OBJECT_BASE     base.epl
        <FilesMatch "\.html">
                SetHandler  perl-script
                PerlHandler Embperl::Object
                Options     ExecCGI
        </FilesMatch>
        Options -Indexes
</VirtualHost>

<Directory "/var/www/sites/semi/admin">
        AuthUserFile  /var/www/sites/semi/admin/.htpasswd
        AuthName "Administration SEMI"
        AuthType Basic
        require valid-user

        <Files *.cgi>
                AddHandler cgi-script .cgi .pl .htm
                Options ExecCGI
        </files>
</Directory>

The /etc/apache2/conf.d/charset file is empty (all commented out).

Nothing charset-related in apache2.conf (standard Debian squeeze file)

The "base.epl" file contains this (I have UTF-8 accented characters in my 
pages) :
        use utf8;
        use encoding "utf8";
        $http_headers_out{'Content-Type'}="text/html; charset=utf-8";

and :
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

I tried creating a "test" subdir containing only the upload module and a 
simplistic base.epl :
[-
Execute("$ENV{DOCUMENT_ROOT}/basedb.epl");
Execute('*');
-]
(basedb.epl only creates the $req->{dbh} handle to the DB)
Still no change.

Where can this encoding come from ? And why are the files smaller than the 
originals (UTF8 should
only enlarge the file when it encounters unknown chars, no ?) And why don't 
they always have the
same size ?

Last clue : it *seems* that when I restart apache I can reliably do ONE upload.

I run out of ideas so if anyone has one, I'll take it. Thanks for your help.

--
Jean-Christophe Boggio                       -o)
embp...@thefreecat.org                       /\\
Independant Consultant and Developer        _\_V

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscr...@perl.apache.org
For additional commands, e-mail: embperl-h...@perl.apache.org

Reply via email to