Re: [C#] File Upload to PostgreSQL - Mailing list pgsql-sql

From David G. Johnston
Subject Re: [C#] File Upload to PostgreSQL
Date
Msg-id CAKFQuwZdn74KPJJUX1bNmomSr6zebufgExHCFZseVnupqiMf2g@mail.gmail.com
Whole thread Raw
In response to [C#] File Upload to PostgreSQL  (drunken <manuzi1@hotmail.com>)
List pgsql-sql
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.

pgsql-sql by date:

Previous
From: drunken
Date:
Subject: [C#] File Upload to PostgreSQL
Next
From: John Sherwood
Date:
Subject: PGSQL-Performance mailing list