September 30th, 2002, 12:47 PM
Upload file related to advert
I am writing a website that I want to allow users to add an advert and then upload 4 pictures relating to that.
I know how to do a simple file upload but does anyone know of a way of associating their pictures with their advert, without making the user name the files to suit etc. Bit baffled... but, i'm sure it can be done easily once you know how!
September 30th, 2002, 02:42 PM
How are you storing the advertisement? Database? Can you add fields to reference the filenames?
October 1st, 2002, 09:11 AM
Yes the advert is being stored in a mysql database. The user fills in their required advert and then uploads pictures of it. I can add more fields to accomodate a solution...
October 1st, 2002, 11:21 AM
Create another table that stores an advert-to-picture-path relationship. That way you can have more than 4 pictures per advert if you need them.
October 1st, 2002, 11:26 AM
So is it possible to grab the names of the files that the user is uploading? If so thats a good solution.
Anybody got any examples that do this?