View Single Post
  #1 (permalink)  
Old 12-13-03, 03:06 PM
grafixDummy grafixDummy is offline
New Member
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Upload file to table so ONLY files tied to primary key are displayed in record?

Hello all, I hope this makes sense. I'm a ponytail in a propellerhead world.

I'm looking for an example of code to upload/insert an image file to a field of a table and have only the files associated with the primary key of the table be displayed in the detail view as download links.

I've found and got wirking many examples of uploaders that put the files into a directory, but in detail view of the table (got that working too), ALL files in the directory are listed as downloads because the scripts I have working don't use mysql to relate individual files to a record. Not what I want. I need each record to only display links to only files associated with that record, not the whole directory.

Am I thinking about this the right way? or should I be getting info (path/mime type, name, etc..) from the file and inserting that info (maybe as an array?) into mysql table and then displaying the PATH to the file (still sitting in the directory with all the others) as a link tied to the primary key of the table?

The first way sounds easier (would I use blob?), but something tells me the second way is better. I'm not the brightest bulb when it comes to coding (as my name implies), but I'm good with examples to modify.

I knows its lots of questions, but any reply would be GREATLY appreciated.
Reply With Quote