On Tue, 31 Aug 2004, Alex Oboimov wrote: > Hi folks, > > I'm fresh to Apache2/mod-perl2, just migrated from > mp1. > > My system: Apache 2.049/Perl 5.8.4/mod_perl > 1.99_14/DBI 1.42/DBD::InterBase/FireBird 1.5 on > linux Mandrake 9.2 engine. > > My problem: my old programs were fine in the old > system. Now after major editing of the programs > they work except for files uploading that > does not work properly. > > After parsing my multipart/form data I get $buffer > with file's content, then I twice 'chop' it (for > extra '\r\n' symbols) & put it in my SQL statement. > The program executes fine but after downloading > the file of 'application/msword' type is unusable > while all other types (zip, rar, pdf, jpg et > al) download just OK. The file becomes two bytes > longer and is not recognized as .doc type. > > What the reason might be? I suspect that some > settings in httpd.conf might preclude some sort of > conversion for this sort of files. Any suggestions?
Are you using libapreq2 to handle the file upload? Or something else? Does this problem arise for clients both on Unix and Windows? Is it browser-specific? Do you know at what stage the corruption in the .doc file occurs (eg, on upload, storing it in the database, or on download)? Do you know why the extra \r\n occur? Normally these are an issue only with text files, in going between Unix and Windows - one might think that for binary files no such mangling need be done (as long as all appropriate handling of the files at all stages is done in binary mode, if applicable). If you don't chop(), is there a difference between how .doc and other binary (eg, .zip) files are handled? -- best regards, randy kobes -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html