|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Save FileOn a application I am saving files to a few folders and for each one I have a record on a database. I rename most files so that the Id of the record becomes the filename. But in some cases I don't. For example, on my database should I have a column named Path which could become: Path = "Repository/Products/MyImage.jpg"; Or use two columns in the database as: Path = "Repository/Products"; FileName = "MyImage.jpg" I am just wondering how people usually do it. I might be forget some issue that can favor one of the approaches. Any advice is welcome. Thanks, Miguel Either On Would be Fine
My self in our system with millions of files i use Path+Filename if paths change then i just update finding old path replace with new path (this happens but not often) if you have tons of files like we do... we make a folder structure based on day for example CustomerAbc D:\CustomerFiles\ AbcCustomer\20090601 20090602 in this case many Users send many Files for one Customer...so by doing Folders it keeps file count low for the os to process so this would be stored in the Datbase table \\Server\CustomerFiles\AbcCustomer\20090601\SomeFilename.jpg DaveL Show quoteHide quote "shapper" <mdmo***@gmail.com> wrote in message news:ce4c0600-a0b3-4863-a84f-89bf501fc01b@24g2000yqm.googlegroups.com... > Hello, > > On a application I am saving files to a few folders and for each one I > have a record on a database. > I rename most files so that the Id of the record becomes the filename. > But in some cases I don't. > > For example, on my database should I have a column named Path which > could become: > > Path = "Repository/Products/MyImage.jpg"; > > Or use two columns in the database as: > > Path = "Repository/Products"; > FileName = "MyImage.jpg" > > I am just wondering how people usually do it. > I might be forget some issue that can favor one of the approaches. > > Any advice is welcome. > > Thanks, > Miguel > > On Thu, 02 Jul 2009 04:40:36 -0700, shapper <mdmo***@gmail.com> wrote:
> [...] IMHO, the main issue is whether you can avoid repeating the path > For example, on my database should I have a column named Path which > could become: > > Path = "Repository/Products/MyImage.jpg"; > > Or use two columns in the database as: > > Path = "Repository/Products"; > FileName = "MyImage.jpg" > > I am just wondering how people usually do it. > I might be forget some issue that can favor one of the approaches. information. For example, you've got a record in which there are multiple files, all using the same path. Or you can store the path information in a separate table that can be related to records in the table where the file names are used. Or you have some way of making the file name column optional when the file name is simply based on some other data in the record. If for every FileName column you will have a Path column and vice a versa, then I'd just put everything in the same string and column. The code to manipulate the path vs. file name gets a tiny bit more complex, but the Path class makes that fairly easy to manage, and the database itself should be that much more efficient. Pete
Other interesting topics
|
|||||||||||||||||||||||