It seems as though the is solved by changing this line in the theme function:

$output = l($image, $item['filepath'], $link_attributes, NULL, NULL, FALSE, TRUE);

to

$output = l($image, file_create_url($item['filepath']), $link_attributes, NULL, NULL, FALSE, TRUE);
CommentFileSizeAuthor
#4 jlightbox-DRUPAL-5.url_.patch659 bytessun

Comments

sun’s picture

Status: Active » Closed (won't fix)

No, spaces in filenames are not allowed. You might use Transliterate filenames module to ensure proper filenames.

For further information see http://drupal.org/node/43505

snelson’s picture

Well, its up to you...

I patched the code for my install because Imagefield lets filenames right on through (they are allowed). In all other places I checked, the file is displayed fine, except for in the lightbox. In the places where it is displayed, the spaces are replaced with %20, but in lightbox, they are replaced with +.

Now, if I'm naming a file for web myself, I know better than to use spaces in the filename. But for my client, who doesn't know better, if the form lets the file through, then it should work everywhere that file is used on the site.

It really just needs a urlencode, which is what it gets through file_create_url(), a necessary thing to do anyway, in my opinion.

jmav’s picture

Status: Closed (won't fix) » Active

Sun wouldn't be better to add this functionality, so module could be more flexible.
Please do include function file_create_url in next version, it wont hurt the module.

I must say that I did change from thickbox to this module because i believe that this module is better, don't make me change my mind.

sun’s picture

Title: Not loading large image when using a CCK Imagefield that has spaces in the filename » Imagefield image filename containing special chars not loaded
Status: Active » Needs review
StatusFileSize
new659 bytes

Please test attached patch.

Wouter Van den Bosch’s picture

Had the very same issue and would like to confirm that this patch fixed my problem.

Cheers !

sun’s picture

Status: Needs review » Reviewed & tested by the community
sun’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.