Thread: [C#] File Upload to PostgreSQL

[C#] File Upload to PostgreSQL

From
drunken
Date:
Hello,

I am Marc from GB.

I have a problem, i cannot upload a file to my PostgreSQL Database.

I don't find the command what I have to use.
I have tried:

fileUpload.PostedFile.SaveAs(....)

Lets say I have the DB on the Server on 8.8.8.8 the DB is called "test" and
the table "upload" has an ID, name, timeupload and file.
The file is a bytea type. Is this correct?
How is the path called?

Best Regards



--
View this message in context: http://postgresql.nabble.com/C-File-Upload-to-PostgreSQL-tp5856051.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



Re: [C#] File Upload to PostgreSQL

From
"David G. Johnston"
Date:
On Wednesday, July 1, 2015, drunken <manuzi1@hotmail.com> wrote:
Hello,

I am Marc from GB.

I have a problem, i cannot upload a file to my PostgreSQL Database.

I don't find the command what I have to use.
I have tried:

fileUpload.PostedFile.SaveAs(....)

Lets say I have the DB on the Server on 8.8.8.8 the DB is called "test" and
the table "upload" has an ID, name, timeupload and file.
The file is a bytea type. Is this correct?
How is the path called?

Best Regards


With bytea you read the content of the file into memory using whatever language you program in and then "insert into upload (file) values (?);" and pass in the content via whatever parameter methods your language uses.

Your language API may provide for attaching an input stream for the parameter.

David J.