agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feed[C#] File Upload to PostgreSQL
2+ messages / 2 participants
[nested] [flat]
* [C#] File Upload to PostgreSQL
@ 2015-07-01 08:10 drunken <manuzi1@hotmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: drunken @ 2015-07-01 08:10 UTC (permalink / raw)
To: pgsql-sql
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.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [C#] File Upload to PostgreSQL
@ 2015-07-01 12:17 David G. Johnston <david.g.johnston@gmail.com>
parent: drunken <manuzi1@hotmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: David G. Johnston @ 2015-07-01 12:17 UTC (permalink / raw)
To: drunken <manuzi1@hotmail.com>; +Cc: 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.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-07-01 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01 08:10 [C#] File Upload to PostgreSQL drunken <manuzi1@hotmail.com>
2015-07-01 12:17 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox