<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Re: [Seaside] Downloads and filenames with diacritics</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Have you tried hexing the bytes and using that as a filename?<BR>
<BR>
(aString asByteArrayEncoding: #utf8) asHexString<BR>
<BR>
-Boris (via BlackBerry)<BR>
<BR>
----- Original Message -----<BR>
From: seaside-bounces@lists.squeakfoundation.org <seaside-bounces@lists.squeakfoundation.org><BR>
To: Seaside - general discussion <seaside@lists.squeakfoundation.org><BR>
Sent: Tue Sep 28 09:24:26 2010<BR>
Subject: Re: [Seaside] Downloads and filenames with diacritics<BR>
<BR>
Yeah, we actually saw that possibility but I was hoping to make the app not to be forced to maintain the original name in the database (so it can't never be confused about it nor inject maintenance costs).<BR>
<BR>
What do you guys think about some other way to encode the filename that preserves the original (with diacritics) but for the OS (and xsendfile) it can look like a non-diacritical one?<BR>
<BR>
any ideas? (or encoders to suggest?)<BR>
<BR>
sebastian<BR>
<BR>
<BR>
<BR>
On Sep 28, 2010, at 1:11 PM, Miguel Cobá wrote:<BR>
<BR>
> El mar, 28-09-2010 a las 13:03 -0300, Sebastian Sastre escribió:<BR>
>> Hi guys,<BR>
>><BR>
>> I've been using this:<BR>
>><BR>
>> (GRCodec forEncoding: 'utf-8') encode: aFilaname<BR>
>><BR>
>> just before writing an uploaded file (that probably has diacritics in its name).<BR>
>><BR>
>> The thing is that xsendfile doesn't find the ones with diacritics and the download fails. Non diacritical downloads works just fine.<BR>
>><BR>
>> As workaround I'm forcing filenames to be non-diacritical while we find a solution.<BR>
>><BR>
>> Wonder if any of you guys have solved making your webapp to offer files download even when the filenames has diacriticals? I mean with xsendfile (from a seaside app of course).<BR>
><BR>
> Store the files with numbers and save the original name in the database.<BR>
> Xsendfile the numbered file and state that the file should be offered<BR>
> with the original name. For example, in PHP:<BR>
><BR>
> header("X-Sendfile: $numberedfile");<BR>
> header("Content-Type: application/octet-stream");<BR>
> header("Content-Disposition: attachment; file=\"$originalname\"");<BR>
><BR>
> The downloaded file needs not to be the same name that the save as<BR>
> offered by the browser.<BR>
><BR>
> Cheers<BR>
><BR>
>><BR>
>> sebastian_______________________________________________<BR>
>> seaside mailing list<BR>
>> seaside@lists.squeakfoundation.org<BR>
>> <A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
><BR>
> --<BR>
> Miguel Cobá<BR>
> <A HREF="http://miguel.leugim.com.mx">http://miguel.leugim.com.mx</A><BR>
><BR>
> _______________________________________________<BR>
> seaside mailing list<BR>
> seaside@lists.squeakfoundation.org<BR>
> <A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
<BR>
_______________________________________________<BR>
seaside mailing list<BR>
seaside@lists.squeakfoundation.org<BR>
<A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
</FONT>
</P>
</BODY>
</HTML>