This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes Uploading file to postgres database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploading file to postgres database" Watch "Uploading file to postgres database" New topic
Author

Uploading file to postgres database

Eleazar Araujo
Greenhorn

Joined: Oct 20, 2012
Posts: 2
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

Joined: Oct 31, 2011
Posts: 502

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


PM Me If You Want to get Urgent Help on Java Programming
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading file to postgres database
 
It's not a secret anymore!