Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Regex problem when uploading image

Quote Reply
Regex problem when uploading image
Hi,
no matter which regex I set for an image upload field, it won't allow link to be added:"Thumbnail cannot contain the value 'test.jpg'"

I tried the regex from the manual and several that I found browsing this forum. They won't work. Only way to have it work is with removing the regex.

So what regex should I set ?

Thanks,
Brakkar


Quote Reply
Re: [brakkar] Regex problem when uploading image In reply to
Hi,

Mmm..what regex are you using?

I'd try;

^([%\w-]+\.(?:jpe?g|JPE?G|gif|GIF|png|PNG)|)$

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Regex problem when uploading image In reply to
I also had problems with images not being accepted so tried your Regex Andy cut and pasted it be sure there were no error. I get this error

+Image cannot contain the value &#039hunslet.jpg&#039+

Doesn't matter what image I try or whatever type gif,png,jpg the error is the same.

- Wayne-
Quote Reply
Re: [balita] Regex problem when uploading image In reply to
Hi,

Mmm.. whats the stuff in front of the image name? :/

&#039hunslet.jpg&#039+


Are you sure you're selecting the right image? It looks like they are quotes ("), which is why it wouldn't be getting accepted.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Regex problem when uploading image In reply to
Andy thanks for fast response ...

There is nothing in front of the image title I am using browse and selecting

hunslet.jpg

from the desktop and that is the error Links throws up - I have even saved the image again under various title, even converted it to gif and png - same error. I have tried about 6 different image files all create the same error - there are definitely no quotes in any of the titles.

Wayne
Quote Reply
Re: [balita] Regex problem when uploading image In reply to
Hi,

If you don't mind sending over GLinks admin panel details, I don't mind having a quick look for you. Probably something simple :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Regex problem when uploading image In reply to
Hi,

For anyone interested, it was just due to an extra space at the end of th regex (after the $). I removed that, and it works fine now Cool

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Regex problem when uploading image In reply to
Andy, would that regex allow files with _'s and -'s in them? Seem to keep getting this message.

  • Image 1 cannot contain the value 'SMV_HPP_banner_250x250_en.gif'

Quote Reply
Re: [shrirch] Regex problem when uploading image In reply to
Not 100% sure without testing, but try:

^([%\w-_]+\.(?:jpe?g|JPE?G|gif|GIF|png|PNG)|)$

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!