[Seaside] Downloads and filenames with diacritics

Miguel Cobá miguel.coba at gmail.com
Tue Sep 28 16:11:52 UTC 2010


El mar, 28-09-2010 a las 13:03 -0300, Sebastian Sastre escribió:
> Hi guys,
> 
> I've been using this:
> 
> (GRCodec forEncoding: 'utf-8') encode: aFilaname
> 
> just before writing an uploaded file (that probably has diacritics in its name). 
> 
> The thing is that xsendfile doesn't find the ones with diacritics and the download fails. Non diacritical downloads works just fine.
> 
> As workaround I'm forcing filenames to be non-diacritical while we find a solution.
> 
> 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).

Store the files with numbers and save the original name in the database.
Xsendfile the numbered file and state that the file should be offered
with the original name. For example, in PHP:

    header("X-Sendfile: $numberedfile");
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; file=\"$originalname\"");

The downloaded file needs not to be the same name that the save as
offered by the browser.

Cheers

> 
> sebastian_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-- 
Miguel Cobá
http://miguel.leugim.com.mx



More information about the seaside mailing list