Mariusz wrote: > What type of field should I use for storing the path; just > VARCHAR I guess? > And as far as the filenames - make up some random file name for each > submitted file?
This is a little off topic for a Perl list, but I'll give it a shot. Be forewarned, that I do not know much about MySQL. I am writing this based on my experiences with Oracle and other DB languages. It all depends on how you want to handle it. Varchar would work fine for storing a path. If you wanted to, you could also come up with a random name for the file. Of course, you would have to do some checking to ensure the file name was not in use, or maybe just use a fancy directory naming scheme. > ps. If storing files in the DB is not common, what exactly is > the BLOB type > for? Storing files in the DB is not common, but it is used in some cases. Depending on your application, it may be appropriate. There are several advantages to storing these types of files in the database: 1. You don't have to worry about file names 2. You get an indexed search to find the file itself. In other words, you don't need another system call to get the file off of the file system and then return it. 3. Maybe faster retrieval times (depending on how your hardware and DB are setup). Not real likely unless you have a lot of money to work with. I'm talking Oracle with multiple servers, etc. 4. Restoring the database will restore the files within it 5. All of the database features themselves would apply to the files. For example, greater control over security. Of course, there are also disadvantages: 1. Much larger database (this is a big disadvantage) 2. Probably slower data retrieval times (once again, depending on how things are set up). This would probably be the case for you. 3. BLOBS, GLOBS, etc are typically much harder to work with I'm sure there are many other advantages/disadvantages that I could not think of off hand. Just be aware that in most situations, as a general guideline, you want to store the path to a file, not the file itself. I highly suggest trying it both ways (although I know that sometimes that is impossible). But, never take anyone's word for it! :) Also, try googling for "database storing files" or "database file storage" or something like that. I think you will find a lot of useful information. Hope this helps, Jared -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]