Inserting a default Image
Question:
I want to insert a default image path when the user does not specify an image to be uploaded. In my Access database I defined a default value corresponding to this image path, but I found out that the ASP upoad behavior overwrites the default value with blanks every time the user does not specify a file path. How can I overcome this situaton?
Answer:
No this is not possible. You can't add a default image.
You can however add some code where you display the image. Check if it is empty and if so display a default image - otherwise display normal image
<IMG src="<% if Trim(rsTest.Fields.Item("Image").Value) = "" then Response.Write "default_image.gif" else Response.Write rsTest.Fields.Item("Image").Value %>" >
note that rsTest.Fields.Item("Image").Value is your database field name where the image is in.
Comments
Be the first to write a comment
You must me logged in to write a comment.