[development] upload module or maybe url() bug

Lluís enboig at gmail.com
Mon Jun 30 12:13:11 UTC 2008


check with http://drupal.org/project/transliteration ; it solved my problems

On 6/30/08, Matt Connolly <matt at cabinetuk.com> wrote:
> I have a question about url encoding
>
>  Spaces in URLS are normally translated to "%20" and spaces in queries are
> normally translated into "+", although the "%20" is correctly decoded.
>
>  I'm discovering that private file uploads are not working when there is a
> "+" in the file name. This is being translated into a " " (space) which is
> quite normal for queries.
>
>  With public downloads, (ie accessibly directly via
> http://mydrupalsite/sites/files/fred+wilma.jpg" the file
> works. So apache doesn't translate the + in the file's path name into a
> space, and the file is downloaded.
>
>  With private downloads, the file name is placed into a query, thanks to
> mod_rewrite (or, becomes
> http://mydrupalsite/q?=system/files/fred+wilma.jpg" . You
> can see where the problem is.
>
>
>  I can easily fix this by altering the "file_create_url" function in
> "/includes/file.inc". I know I've been warned to not change drupal's core
> modules and code, but ..... I think I need to.
>
>  However, I wonder if the problem would be better handled in the "url()"
> function?
>
>  I notice that if you create page url's "bananas+pears" and "apples and
> oranges" the urls are all encoded with %20. So it seems you can't use the
> "+" in a custom URL. Butt least here what you type and what you get are
> consistent.
>
>
>  Any thoughts?
>  -Matt
>
>


-- 
*La felicitat ha de ser compatible, compartible i cooperativa.
*Envellim quan els records superen les esperances.
*Als llocs desconeguts només s'hi arriba per camins desconeguts.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.


More information about the development mailing list