Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Software > Adobe Software > Dreamweaver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-2008, 08:36 PM
meesonator
 
Posts: n/a
dynamic image storing

Hi guys,
i am going to be storing hundreds of user uploaded images, and i was wondering
which methode would be better, storing them directly in a SQL database or in an
image folder and then automating a path name in a database field, i was
starting to use the file path methode put i am totally new to coding and all
things web-design and storing them in the database seems easier to implement so
i am exploring the options.
All advice apprieciated.
Cheers.

Reply With Quote
  #2 (permalink)  
Old 09-29-2008, 09:06 PM
Murray *ACE*
 
Posts: n/a
Re: dynamic image storing

> storing them directly in a SQL database or in an
> image folder and then automating a path name in a database field


I wouldn't do either. I'd save the image name in the database field, and do
the path in the HTML on the page. That makes it much easier if you ever
change a folder name. If the path were in the database, you'd have to
change each record.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"meesonator" <webforumsuser@macromedia.com> wrote in message
news:gbran5$7ja$1@forums.macromedia.com...
> Hi guys,
> i am going to be storing hundreds of user uploaded images, and i was
> wondering
> which methode would be better, storing them directly in a SQL database or
> in an
> image folder and then automating a path name in a database field, i was
> starting to use the file path methode put i am totally new to coding and
> all
> things web-design and storing them in the database seems easier to
> implement so
> i am exploring the options.
> All advice apprieciated.
> Cheers.
>


Reply With Quote
  #3 (permalink)  
Old 09-29-2008, 09:11 PM
Sean DeMerchant
 
Posts: n/a
Re: dynamic image storing

It really depends on your server environment. If you have 5 GB of storage and
are only allowed 400 MB of database usage, then database storage is probably
unwise. Try both, see which performs better. You might find the following FF
plugin helpful:

https://addons.mozilla.org/en-US/firefox/addon/1743

Reply With Quote
  #4 (permalink)  
Old 09-29-2008, 09:18 PM
Sean DeMerchant
 
Posts: n/a
Re: dynamic image storing

It really depends on your server environment. If you have 5 GB of storage and
are only allowed 400 MB of database usage, then database storage is probably
unwise. Try both, see which performs better. You might find the following FF
plugin helpful:

https://addons.mozilla.org/en-US/firefox/addon/1743

Reply With Quote
  #5 (permalink)  
Old 09-29-2008, 09:21 PM
Mangler
 
Posts: n/a
Re: dynamic image storing

On Sep 29, 3:36*pm, "meesonator" <webforumsu...@macromedia.com> wrote:
> Hi guys,
> *i am going to be storing hundreds of user uploaded images, and i was wondering
> which methode would be better, storing them directly in a SQL database orin an
> image folder and then automating a path name in a database field, i was
> starting to use the file path methode put i am totally new to coding and all
> things web-design and storing them in the database seems easier to implement so
> i am exploring the options.
> *All advice apprieciated.
> *Cheers.


Trust Murray on this one, he points out the best way to do this ( in
my opinion ). I have done this both ways that you are asking about
and found out the HARD way that Murray's suggestion is the way to go~!
Reply With Quote
  #6 (permalink)  
Old 09-30-2008, 02:51 PM
Michael Fesser
 
Posts: n/a
Re: dynamic image storing

..oO(meesonator)

> i am going to be storing hundreds of user uploaded images, and i was wondering
>which methode would be better, storing them directly in a SQL database or in an
>image folder and then automating a path name in a database field, i was
>starting to use the file path methode put i am totally new to coding and all
>things web-design and storing them in the database seems easier to implement so
>i am exploring the options.


Store the necessary meta information (e.g. filename, date, title or
whatever you need) in the database, but the actual image data as plain
files on disk. That's the most efficient way, because then the server
can deliver those images directly on request. If you would store the
images in the database, then for every single image you would have to
call a script, which may slow things down.

Of course it may also depend on the number of images and what you're
going to do with them. In some cases the DB storage might be the better
choice ...

Micha
Reply With Quote
  #7 (permalink)  
Old 09-30-2008, 07:55 PM
Ronnie MacGregor
 
Posts: n/a
Re: dynamic image storing


On Mon, 29 Sep 2008 16:06:26 -0400
Murray *ACE* said :

> I'd save the image name in the database field, and do
> the path in the HTML on the page. That makes it much easier if you ever
> change a folder name. If the path were in the database, you'd have to
> change each record.


Hmmmm .... but if the path is hard coded in HTML you then have to change this
in every page.

Surely the way to do this is to store the location of each image in two table
fields, the image name, and a path ID.

The path ID can then be resolved from a "lookup table" eg. ImagePaths in order
to construct the full path and file name for the image concerned.

Move a directory full of images and you only have one table row entry to update
to match the new location.

This approach is also much more scaleable.

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Reply With Quote
  #8 (permalink)  
Old 09-30-2008, 08:15 PM
Ronnie MacGregor
 
Posts: n/a
Re: dynamic image storing


On Tue, 30 Sep 2008 15:05:06 -0400
Murray *ACE* said :

> I'm basing my answer on an assumption that such things are usually within
> REPEAT regions on the page, thus, there's only a single path to change.


I see what you mean ... but .....

I'll leave you to move your image directories around in two years time and then
be able to remember which pages need updated !! <g>

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Reply With Quote
  #9 (permalink)  
Old 09-30-2008, 08:53 PM
Sean DeMerchant
 
Posts: n/a
Re: dynamic image storing

You can fix this with a one liner at any decent command line with:

perl -pi.bak -e 's/src="somepath/(.*.jpg)"/src="newpath/${1}"/' *.php

And while this can be dangerous, version control exists for a reason.

Or you could just use grep to find the necessary files:

grep -l 'somepath'

Sometimes GUIs are way more complex than good old fashioned command line
solutions.

[q]Originally posted by: Newsgroup User

On Tue, 30 Sep 2008 15:05:06 -0400
Murray *ACE* said :

> I'm basing my answer on an assumption that such things are usually within
> REPEAT regions on the page, thus, there's only a single path to change.


I see what you mean ... but .....

I'll leave you to move your image directories around in two years time and
then
be able to remember which pages need updated !! <g>
--
Ronnie MacGregor
[/q]



Reply With Quote
  #10 (permalink)  
Old 09-30-2008, 10:16 PM
Ronnie MacGregor
 
Posts: n/a
Re: dynamic image storing


On Tue, 30 Sep 2008 19:53:54 +0000 (UTC)
Sean DeMerchant said :

> You can fix this with a one liner at any decent command line with:
>
> perl -pi.bak -e 's/src="somepath/(.*.jpg)"/src="newpath/${1}"/' *.php


Hi Sean

Yes ... there are many ways to fix a problem, I was just trying to point out a
method that prevents the problem.

A good general rule for coding in any language is :

"Never hard code anything that could be variable"

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Software > Adobe Software > Dreamweaver


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:14 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Internet Advertising | Loans | Bad Credit Loan | BabbFest | MySpace Templates



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114