Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading file to postgres database

 
Eleazar Araujo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have an application that uses POSTGRESQL, JSP and the STRUTS Framework
I want to insert a file into a table in postgresql using the OID type.

My table definition is this one:

CREATE TABLE mensaje
(
id serial NOT NULL,
file oid,
CONSTRAINT pk_mensaje PRIMARY KEY (id)
)
WITH (
OIDS=TRUE
);
ALTER TABLE mensaje
OWNER TO postgres;


Anybody knows an example of how the Action, the ActionForm and the .jsp should be?
If not, is there any other way to do it without using the OID type?

Thanks
 
Nam Ha Minh
Ranch Hand
Posts: 502
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I don't know the PostgreSQL part, but for the upload part with Struts, I suggest you to follow this link:

Upload files with Struts2
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic