|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
||||
|
||||
|
Hi there,
I am working on an application with which I want to upload files (word docs, PDFs etc.) to a MS SQL database from a website form (Browse button etc.). Unfortunately, I have no clue where to start. Could anyone point me into the right direction please? What type is the column where the file is stored in and how is the INSERT statement or UPDATE statement in SQL? Thanks for your help, N ![]() |
|
#2
|
|||
|
|||
|
Hi,
The type of the column should be "IMAGE" as this simply holds a series of bytes. You can use INSERT INTO mytable (Col1, MyDocColumn) VALUES (Something, :MyDoc) Prepare it and bind the parameter. As for your "browse" button and how to bind parameters, that all depends on your serverside programming language.
__________________
Martijn Tonies Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle Upscene Productions http://www.upscene.com |
|
#3
|
||||
|
||||
|
Thanks for the first pointers
When you said INSERT... (...., :MyDoc), do you actually mean ":example.pdf"? I tried to find information about this in the official MS SQL Server Books, but with no success... The "bind" thing you mentioned, has this to be done on DB level? I am just provided the DB, ie. I have no DBA rights at all. I can access the tables, ie. INSERT, UPDATE, DELETE. This is as much as I can do... Thanks for your help. N |
|
#4
|
|||
|
|||
|
Hi,
Quote:
No, what I meant with :MyDoc, is that ":MyDoc" is a parameter. I come from a Delphi background, we use parameters often in queries. After preparing the query, we can then bind the parameter to the actual data. In Delphi, this would become: qry.ParamByName('MyDoc').LoadFromStream(the memory stream that has the document, inside the web-application that receives the web-form) (pseudocode of course). What language are you using server side? |
|
#5
|
||||
|
||||
|
PHP server side language
Hi there,
thanks for your reply. I am using PHP. For my websites, I normally use MySQL and I know my way round there, but MSSQL is slightly different. I have no probs inserting and updating data into MS SQL rows. So this parameter (makes more sense now), where would I set it? In my web application? I suppose I have to define it somewhere? sorry when this sounds amateurish... Thanks a lot!!! N |
|
#6
|
|||
|
|||
|
Yes, in your web app.
But, I don't know how to do this stuff in PHP - you might want to check the manuals for this. |
|
#7
|
||||
|
||||
|
cheers. will do that, good old php dot net
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Files to be stored in DB, how?? (MS SQL) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|