> Could anyone shed some light on how to go about uploading a text file
> with a web interface using php into a mysql database.  wow, that was a
> mouthfull.  I would much appreciate it.

Well, that depends.  Do you want to store the native text file fully
intact say like you might store an image file or a word document, or,
instead are you only interested in just the text.

Secondly, what do you wish the the input UI to look like?  Do you just
want them to enter in a filename, or, is pasting into a text box
sufficent?

If you objective is merely for them to paste into a textbox the task is
simple enough.. just create a table with a blob/text element and use your
form to populate (standard PHP usage of forms/variables at work here of
which I won't go into detail here on).

If you goal is to merely accept filenames and go from there might I
suggest you taking a look here:
http://www.php.net/manual/en/features.file-upload.php

Once you have your data from the user the question returns to whether you
want to store the native file format (applies more if you are intending to
handle formatted text such as in word, rtf, or some other format), or just
the text.  Depending on how large your text/data files are you might
consider using your database as merely an indexing agent.  This could be
as simple as creating a database managed directory structure on one of
your servers, placing your text files in there and then having the
database point to them either by ID or store the location (the prior is
probably ideal).  Or, you could do the prior and add in some full text
word indexing such as with a B-tree index.  The point here is that your
harddisk makes for a fairly good blob storage device.. no use not making
use of it when compared to loading up your database with tons of data
which doesn't add to the queryability of the data while limiting your
database's ability to scale.

Regards,
seth

---
Seth Northrop
Manager of Information Technology
Reflectivity, Inc.
3910 Freedom Circle, Suite 103
Santa Clara, CA 95054
voice:  408-970-8881 x147
fax:    408-970-8840
http://www.reflectivity.com/


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to