Gossamer Forum
Home : Products : Gossamer Links : Discussions :

[EXAMPLE] Image upload help.. using FILE types

Quote Reply
[EXAMPLE] Image upload help.. using FILE types
Hi,

I thought I'd post this as a bit of help, for those who are struggling with file uploads :) (this example is for images, gif/jpg/png);

Quote:
Column Name: Image1
Column Type: CHAR
Column Size: 255
Not Null: No

Form Information

Form Display: Image 1
Form Type: FILE
File Save Location: /full/path/to/where/images/should/be/saved
File Save URL: http://www.domain.com/full/location/where/images/should/be/saved/
File Save Method: HASHED
File Maximum Size: 250000
Form Regex : ^([%\w-]+\.(?:jpe?g|JPE?G|gif|GIF|png|PNG)|)$


You also need to add something like this in include_form.html;


<div class="row clear">
<label for="Image1" class="name">Image:</label>
<div class="value">
<input type="file" name="Image1" class="text">
</div>
</div>

Hope that helps anyone whos looking at adding image uploads in GLinks 3.0.x Smile

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!

Last edited by:

Andy: Nov 1, 2008, 3:16 AM
Quote Reply
Re: [Andy] [EXAMPLE] Image upload help.. using FILE types In reply to
Hi ANdy,

Thanks for posting this, it has helped me out alot.

I have added the code above. I don't get any errors however when I log in as a user (include-form) and upload an image, when the admin goes and validates the link, the images that the user posted is not showing up. Do you have any idea why? Also is thier way for the user to be able to (download and view) the images, like it is in the admin panel?
Quote Reply
Re: [netnow21] [EXAMPLE] Image upload help.. using FILE types In reply to
It won't actually show up. You need to click the "view" or "display" link next to the image field. It's not an inline display, unfortunately. But, it allows for non-image file types.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Post deleted by theguy In reply to
Quote Reply
Re: [pugdog] [EXAMPLE] Image upload help.. using FILE types In reply to
do we need to add something to link.html?

because the uploaded file is not there in the directory
it's only found in the admin area
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
Depends if you have the enctype="multipart/form-data" part in your <form ...> part =)

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] [EXAMPLE] Image upload help.. using FILE types In reply to
this is what i got

<form action="<%db_cgi_url%>/add.cgi" enctype="multipart/form-data" method="POST">

do i need to change it to make it work as i want it?
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
could someone please help me.
how to make this thing work properly
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
Hi,

I think you still need to use a global to display the image. Here is a very old thread that I think is still valid:
http://www.gossamer-threads.com/...i?post=184526#184526
Quote Reply
Re: [afinlr] [EXAMPLE] Image upload help.. using FILE types In reply to
i don't need to add an image, i want to add a pdf file which the admin can see but not everyone's else. i want the link to the pdf to be shown next to the link
Quote Reply
Re: [Andy] [EXAMPLE] Image upload help.. using FILE types In reply to
did i explain myself clearly or do i need to explain it better?

just like there is a link to review it and rate in the directory i want a link to the PDF which is found in admin area but not in the directory
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
the maker of the software used to be alot more helpfull 5 years ago.
did Alex sell the company
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
yea you can still get alot of help here but it takes alot longer than it used too. Not sure why, maybe not as many people use this product as much as they used too.
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
In Reply To:
i don't need to add an image, i want to add a pdf file which the admin can see but not everyone's else. i want the link to the pdf to be shown next to the link

<%config.db_cgi_url%>/jump.cgi?ID=<%ID%>;view=FIELD_NAME

i.e;

<%config.db_cgi_url%>/jump.cgi?ID=<%ID%>;view=PDF_File

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] [EXAMPLE] Image upload help.. using FILE types In reply to
when someone modify a link or submit a review then i have to validate it before it appears, how can i make it show up without validation
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
Hi,

You can't :( The problem is a very old one. Basically, when you have "Validate Changes" set to "yes", it saves the changes to lsql_Links_Changes. The image is updated in real time (i.e after they submit the changes). This is something I battled with a lot in Thumb_Images (exactly the same problem).

Maybe GT have a solution now that I'm not aware of? Angelic

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] [EXAMPLE] Image upload help.. using FILE types In reply to
how about when you submit a review?

i want it to be shown whithout validation? is this possible?
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
You have to turn off admin validation :(

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] [EXAMPLE] Image upload help.. using FILE types In reply to
i did turn off administration validation when someone submit a link but where do i turn it off for review
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
Setup => Review Options => review_auto_validate

Adrian
Quote Reply
Re: [brewt] [EXAMPLE] Image upload help.. using FILE types In reply to
i'm using links sql 2.1.1

this option is not available
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
Sorry, that option was added in GLinks 3.0.1.

Adrian
Quote Reply
Re: [brewt] [EXAMPLE] Image upload help.. using FILE types In reply to
is there anyway to do it in links sql 2.1.1
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
there should be a way to do it.
please someone help me
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
Your options are to either upgrade to 3.x (which is a free upgrade), or pay someone to add the functionality into your copy.

Adrian
Quote Reply
Re: [brewt] [EXAMPLE] Image upload help.. using FILE types In reply to
is it worth it to upgrade? what new features have been added.

do i need to make any changes to the templates?

Last edited by:

theguy: Apr 1, 2006, 1:42 AM
Quote Reply
Re: [Andy] [EXAMPLE] Image upload help.. using FILE types In reply to
it's working just fine but i noticed it's got a minor error when someome upload a file name
"my photo" notice the space it gives me an error and i can not upload it and it works if the file name is one word like myphoto or my_photo
can this be fixed?

In Reply To:
Hi,

I thought I'd post this as a bit of help, for those who are struggling with file uploads :) (this example is for images, gif/jpg/png);

Quote:
Column Name: Image1
Column Type: CHAR
Column Size: 255
Not Null: No

Form Information

Form Display: Image 1
Form Type: FILE
File Save Location: /full/path/to/where/images/should/be/saved
File Save URL: http://www.domain.com/full/location/where/images/should/be/saved/
File Save Method: HASHED
File Maximum Size: 250000
Form Regex : ^([%\w-]+\.(?:jpe?g|JPE?G|gif|GIF|png|PNG)|)$


You also need to add something like this in include_form.html;


<div class="row clear">
<label for="Image1" class="name">Image:</label>
<div class="value">
<input type="file" name="Image1" class="text">
</div>
</div>

Hope that helps anyone whos looking at adding image uploads in GLinks 3.0.x Smile

Cheers
Quote Reply
Re: [theguy] [EXAMPLE] Image upload help.. using FILE types In reply to
In Reply To:
it's working just fine but i noticed it's got a minor error when someome upload a file name
"my photo" notice the space it gives me an error and i can not upload it and it works if the file name is one word like myphoto or my_photo
can this be fixed?

This is an old issue
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=261760#261760


Maybe you could fix it with regex ^(?:|[\w-\.]+\.(?i:jpg|jpeg|jpe|gif))$
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=292255#292255


Quote Reply
Re: [Andy] [EXAMPLE] Image upload help.. using FILE types In reply to
In Reply To:
Hi,

I thought I'd post this as a bit of help, for those who are struggling with file uploads :) (this example is for images, gif/jpg/png);

Quote:
Column Name: Image1
Column Type: CHAR
Column Size: 255
Not Null: No

Form Information

Form Display: Image 1
Form Type: FILE
File Save Location: /full/path/to/where/images/should/be/saved
File Save URL: http://www.domain.com/full/location/where/images/should/be/saved/
File Save Method: HASHED
File Maximum Size: 250000
Form Regex : ^([%\w-]+\.(?:jpe?g|JPE?G|gif|GIF|png|PNG)|)$


You also need to add something like this in include_form.html;


<div class="row clear">
<label for="Image1" class="name">Image:</label>
<div class="value">
<input type="file" name="Image1" class="text">
</div>
</div>


Hope that helps anyone whos looking at adding image uploads in GLinks 3.0.x Smile

Cheers



File Maximum Size: 250000 will not work on the modify form - it will allow you to upload file which size exceeds the value in File Maximum Size

And when you validate changes in admin, admin will notify you that file size is bigger than allowed.

This is a very old bug

Check here http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=266247#266247

And be sure to read the next post Crazy

Sometime I really do not understand GT policy on bugs. We help them to find/correct bugs, we take the time to report hem and what they do - fix only one version.

Maybe they should have some kind of bug reporting interface or something like that.
Quote Reply
Re: [Payooo] [EXAMPLE] Image upload help.. using FILE types In reply to
nope that did not solve the problem the file name should be one word otherwise it would not work
Quote Reply
Re: [Payooo] [EXAMPLE] Image upload help.. using FILE types In reply to
In Reply To:
File Maximum Size: 250000 will not work on the modify form - it will allow you to upload file which size exceeds the value in File Maximum Size
I just tested this on GLinks 3.1.0, and it works fine.

Adrian
Quote Reply
Re: [brewt] [EXAMPLE] Image upload help.. using FILE types In reply to
In Reply To:
In Reply To:
File Maximum Size: 250000 will not work on the modify form - it will allow you to upload file which size exceeds the value in File Maximum Size

I just tested this on GLinks 3.1.0, and it works fine.

How did you tested this?
I also run 3.1.0 and it does not work fine Crazy
Place upload file field on mofify form, not just through admin...
Quote Reply
Re: [brewt] [EXAMPLE] Image upload help.. using FILE types In reply to
Hi brewt,

What do you (GT) think about:

"Sometime I really do not understand GT policy on bugs. We help them to find/correct bugs, we take the time to report hem and what they do - fix only one version.

Maybe they should have some kind of bug reporting interface or something like that."

Quote Reply
Re: [Payooo] [EXAMPLE] Image upload help.. using FILE types In reply to
Oops, my installation had user_direct_mod enabled. I've posted an update that fixes the file check problem.

Adrian
Quote Reply
Re: [Payooo] [EXAMPLE] Image upload help.. using FILE types In reply to
In Reply To:
"Sometime I really do not understand GT policy on bugs. We help them to find/correct bugs, we take the time to report hem and what they do - fix only one version.
That post was reporting the problem that the regex wasn't being checked and that was fixed and has been fixed ever since Links SQL 2.2.0. I'm not sure why you would say that it was only fixed in one version. The file size check problem is a separate bug (that wasn't reported in that thread).

In Reply To:
Maybe they should have some kind of bug reporting interface or something like that."
I believe that an extra interface for bug reporting would make things more complicated for most users; especially since using the forum for bug reports has been working well.

Adrian

Last edited by:

brewt: Jun 25, 2006, 2:32 AM