Skip site navigation (1) Skip section navigation (2)

input large object from internet

From: "S(dot)A(dot)Pamungkas" <moenk_2000(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: input large object from internet
Date: 2000-09-19 02:20:33
Message-ID: 20000919022033.11992.qmail@web4904.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi all

According imageviewer example, I made GUI ( by
applet-servlet ) for input data to DB, including blob.
Input data from localhost ( the same PC ) is ok. For
example, I could input image data by writing
"/usr/aji/home.gif" in my GUI. 

My question : Is it possible to input blob from other
computer ( from ineternet ) ?
If YES, how to do that ? Which method should I use ?

This is my servlet skeleton code :

 ............. 
 
 String image_file  = getImage_file(); // resulting
String "/usr/aji/home.gif"
 .......
 if(leccod!=null && teacod!=null && date!=null &&
viname!=null && image_file!=null && dept!=null)
{		
    Statement stat = null;
		
    try
    {		    
      LargeObjectManager lom =
((org.postgresql.Connection)con).getLargeObjectAPI();

      con.setAutoCommit(false);
      byte buf[] = new byte[3000];
      FileInputStream fis = new FileInputStream(new   
       File(image_file));

      int oid = lom.create();
      LargeObject blob = lom.open(oid);
      int s, t=0;
		                                           
while((s=fis.read(buf,0,buf.length))>0)
   {
	t += s;
	blob.write(buf,0)
    }
    blob.close();

    stat = con.createStatement();
    stat.executeUpdate("insert into images values('" +
leccod + "','" + teacod + "','" + date + "','" +
viname + "'," + oid + ",'" + dept + "')");

    con.commit();
    con.setAutoCommit(false);
  ..........

Any suugestion would be appreciate.
Thank you.

-pamungkas-

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Responses

pgsql-interfaces by date

Next:From: Peter MountDate: 2000-09-19 09:21:04
Subject: RE: input large object from internet
Previous:From: Chris HaasDate: 2000-09-18 20:17:37
Subject: upgrade pgaccess v0.96 to v0.98 fatal error: attribute querytables not found

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group