I think that the problem is that I have set the encoding (multi-part) for the post, but not for the file part, and I can't figure out how to set the encoding for the file part. I'm worried that I'm going to have to force a re-conversion within perl from some sort of automatic conversion done when writing to the temporary file.

I do not think there is any way to tell the web browser what the encoding of the uploaded file should be. That only works for form fields such as text areas.

So it's not just me that thinks so. Thanks.

You will get the file in the same encoding (if applicable, this could be a binary file, such as an image, too) that it has on the user's hard disk.

That doesn't seem to match some run-time error messages about codes that could not be converted. I'll have to check those messages again, there's probably a clue in there.

So you will have to auto-detect the encoding on the server-side or give the user a pulldown to select the file encoding (or support only Shift-JIS, which you might get away with in your case).

Do you know of a way to tell perl, or, rather, the CGI module to open the file handle as shift-JIS? Here's where I get the file handle:

if ( !defined( $fileToSend ) || length( $fileToSend ) < 1 || !( $fh = $query->upload( 'file-to-send' ) ) )

I'm not seeing any room in the syntax here: $fh = $query->upload( 'file-to-send' ), but I'm SUCH a newb. (Seriously. If I weren't bald I should be blonde.)

Merry Christmas,

Merry late Christmas and happy holidays to all!

Joel

Thilo


Reply via email to