Welcome Guest, Not a member yet? Register   Sign In
Database Scaffolding and Photos question? Kinda lost....
#5

[eluser]jedd[/eluser]
Quote:I just want to clarify what you are saying: The way to do this is to upload the photos to a folder (which is a sibling of system), and add the photos' URL location (by hand) to a say, a row called "photo_url" (or something similar)?

That's a way, yes Smile photo_url or photo_path - or something meaningful like that, yes. I'd probably avoid using 'url' unless it really is one. It doesn't sound like it is.

You'd probably want to put some .htaccess style protection around the photo directory, of course, so it can't be accessed directly. Or putting it outside the web document root entirely is another option.

Quote:I was hoping there was some kind of scaffolding type feature that would allow me to upload photos and have it save the location to MySQL, rather than adding each location by hand.

Well, you could just write the code that you're talking about - that will let you upload the file, and record it in the database as it goes. Uploading is painful, though, compared to just copying the files across into that directory.

You could also just rattle up some PHP that did a scan of the directory, and inserted details of the existing files into the database.

Quote:Is there a preffered way in CI to grab photos from the database and show them?
[/quote]

Hmmm .. not quite sure what you mean. You'd probably pass the path_info (from the db) via the controller, to your view, as part of your view data, and then in the view just do the usual img src thing - is this what you mean?


Messages In This Thread
Database Scaffolding and Photos question? Kinda lost.... - by El Forum - 03-14-2009, 06:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB