Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

How to...upload Image

Quote Reply
How to...upload Image
I am making a used-cars-sale-site, and would like to allow users to upload their own picture of their car. I have activated upload in Links.pm file, but donīt know any further.

Also...I would like to use a default picture if no picture is uploaded.
Quote Reply
Re: How to...upload Image In reply to
I have not gotten into the file uploads yet, that's my next step, but the default picture is easy.

Use the <%if %> test on the field where their attachment would be. Let's call it "image".

You'd do something _like_:

Code:
<%if image%>
<img src="<%attach_dir%>/<%image%>">
<%endif%>
<%ifnot image%>
<img src="<%attach_dir%>/default.jpg">
<%endif%>