View Full Version : FileSystemObject question
dominicall
11-08-2002, 11:48 PM
I know it's possible to save an image as a BLOB in a database but I have a slightly different challenge.
I've got a form for uploading text/html files to my site. Rather than just save the files in a particular directory I'd like to put the contents of the text/html files into my sql database.
Is it possible to use the FileSystemObject to do this or do I have to do it another way?
Thanks
Dominic :D
rcreyes
11-09-2002, 02:42 AM
FileSystem represents the host computer's filesystem as a whole. You cannot use this object to move the content into a database, you could however use the filesystem object to open a file, read the content into a variable and then save the content of the variable into a column of a table.
I have a similar project, where we save the fullname of the file into a table, but the file itself is save (or move) to a particular location of a file server, i.e.
TABLE (Documents)
-------------------------
DocumentID
File Description
Fullname
A record will look like this:
1001
Template for creating mailing list
\\NY_SERVER\SHR_POINT\DOCUMENT\MailingList.doc
Thanks,
Ray
BigDaddy
11-09-2002, 02:44 AM
Just use a text area. Store the contents of the textarea as a variable in the database.
dominicall
11-09-2002, 08:52 AM
Hey rceyes and BigDaddy
Thanks for the replies... this post was linked to my other post about building and email system using ASPEmail.... it was just far too late last night for me to figure it out - LOL
I knew what need to be done when I woke up this am (how often does that happen ;)) and have tested it and it works OK.
The reason for uploading the file is that I can design the HTML email version offline using Homesite/DW til I'm happy with it and then upload with it.
The solution I've figured out means I don't now need to put the contents of the file into the database (although I might still do so just to be sure) since I can just parse it straight from the FSO and then use it as the mail body/altbody.
Go have a look at http://www.codingforums.com/showthread.php?s=&postid=45474#post45474 for the interim test solution.
When I've build and tested the whole thing rigorously I'll be posting the full solution up here so if anyone needs to do the same kind of thing they can - but I'm sure you guys can figure out the rest anyway.
Thanks though - confirmed my idea that I had when I woke up.
Dominic :D
BigDaddy
11-10-2002, 02:35 AM
Cool. I saw that other post. Didn't make the connection though, of them being the same thing.
I look forward to seeing the final product. :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.