Gossamer Forum
Quote Reply
image upload


I am having trouble with image upload. my database is as follows:

Column Name Photo
Column Type CHAR
Column Index None
Column Size 255
Column Values
Not Null No
Default
Form Information
Form Display Photo
Form Type FILE
Form Size 255
Form Names
Form Values
File Save Location /servers/name/htdocs/files
File Save URL
File Save Method HASHED
File Maximum Size 300000
Form Regex '^|.*\.(?i:gif|jpg|png|bmp)$'

however when i try to upload an image is get this error:
Photo can not contain the value 'Blue hills.jpg'

in my add form. what am i doing wrong?

thanks

Last edited by:

ajiimd: Dec 6, 2004, 7:27 AM
Quote Reply
Re: [ajiimd] image upload In reply to
Hi,

The problem is your Form Regex '^|.*\.(?i:gif|jpg|png|bmp)$'. What do you mean when you use this '^|'? Just replacing '^|' with '^' will work.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] image upload In reply to
thanks for your reply<
i changed to this:

'^'.*\.(?i:gif|jpg|png|bmp)$'

and it still doesn't work

please help
Quote Reply
Re: [ajiimd] image upload In reply to
Hi,

It might be choking on the space. Try URL encoding it, or removing the space, and converting it to an _

Not sure, just a guess.

If you remove the regex, does the photo upload ok?


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [ajiimd] image upload In reply to
The whole expression should be '^.*\.(?i:gif|jpg|png|bmp)$', not having an extra ' after the ^

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] image upload In reply to
thank you so much for your advice:
'^.*\.(?i:gif|jpg|png|bmp)$'
still did not work, but leaving the field empty did work. the new problem is that when i try to modify if, the text box is blank and does not contain the xxx.gif

i am using this in my form page:

<input type="file" name="Photo" value="<%if Photo%><%Photo%><%endif%>">

how can i fix this

cheers,
andrew
Quote Reply
Re: [ajiimd] image upload In reply to
Yes, PUGDOG is right. It should be blank

The field shuld be <input type="file" name="Photo">. File field name does not understand value attribuite. You should add some other options like in admin such as delete checkbox, and view image.

Just that. Lsql will do the rest.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
image upload regex problem In reply to
Hello,
i have the same problem with Version 3.04

error-message for example:

Image1_thumb can not contain the value 'image028.jpg'

I tried the regex like the desvriptions above.

'^|.*\.(?i:gif|jpg|jpeg|png)$' (this is from the manual)
and
'^.*\.(?i:gif|jpg|jpeg|png)$' (this from above)

if i let it blank it works.
BUT i dont want to let it blank, i don t want that somebody load different like images up to the server......
I d like to use regexes.
thanks for reading
regards
manne

i forget:
in the include_form.html:
<div class="row clear">
<label for="Image1_thumb" class="name">Small Image/Thumbnail:</label>
<div class="value">
<input type="file" id="Image1_thumb" name="Image1_thumb" class="text" />
</div>



http://www.edelsteine.de
Quote Reply
Re: [manne] image upload regex problem In reply to
OK, i just found it in the forum thanks to Jonze


^[\w-]+\.(?:jpe?g|JPE?G)$

i think the ? is like either jpg or jpeg, it works.

regards
manne



http://www.edelsteine.de