Add new field in Database - with edit browse button

A place to discuss and receive support for the Web Auction application.

Add new field in Database - with edit browse button

Postby Anthony Barber » Tue Dec 04, 2007 1:43 pm

Hi Steve,
I have added two new fields in the products table:-
product_image_01 ad product_image_02
The fields were placed just below the product_image field.
When I click Add New Product the two new fields are shown in correct position However, I would like a browse button to the right of the field like the original product_image field has.
How do I do that?
Best regards,
Tony
Anthony Barber
 
Posts: 29
Joined: Tue Oct 23, 2007 9:58 am

Postby shannah » Tue Dec 04, 2007 5:07 pm

Hi Anthony,

The product_image field is a container field, meaning that it stores the name of the image, while the image itself is stored on the file system. Hence there are a 3 parts to adding extra image fields.

1. Add the fields in the database as varchar columns (you've done this).
2. Update the fields.ini file for the products table so that these new fields' sections resemble that of the original product_image field. (particularly, you need to have:
Code: Select all
Type=container


3. Let dataface know where you want to store the images. By default it will try to store them in the tables/Products/ directory. You have them saved in the same directory as the original product_image field if you like using the savepath directive.

4. It helps to have an associated field to store the mimetype for each container field also.

For details on how to add container fields like this you can refer to this how-to:
http://xataface.com/documentation/how-t ... le-uploads

Hope this helps a little.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Adding a field with browse button

Postby Anthony Barber » Wed Dec 05, 2007 1:33 pm

Hi Steve,
Thanks for that, it worked great.
I made the mistake of writing Type=container with a small t. But your How to tutorial put me straight on that. I was so pleased to see the pictures pop up after adding a new product. I now need to see how I should show the added pictures on the main screen.
Many thanks again.
Best regards,
Tony
Anthony Barber
 
Posts: 29
Joined: Tue Oct 23, 2007 9:58 am

Postby shannah » Wed Dec 05, 2007 1:39 pm

shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 29 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved