Uploading a file using Struts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • javaflower
    New Member
    • Feb 2008
    • 1

    Uploading a file using Struts

    in JSP , this is the code snippet to upload a file
    Code:
    <li><html:file property="myFile" value="../img/buttons/browse_button.gif"> </html:file>
    in my struts action class, i am fetching it like,

    Code:
    int fileSize       = myFile.getFileSize();
    byte[] fileData    = myFile.getFileData();
    i am trying to insert this file into oracle 10g using the following snippet.
    Code:
    pst.setBytes(3, b);
    (Pst means prepared statement)

    My query is its working fine for the files with size less than 1 KB. but for for large file files its not working.

    in DB, the column type is CLOB only.

    Any body can help me out? thanks in advance
    Last edited by Nepomuk; Dec 12 '08, 11:55 PM. Reason: Please use [CODE] tags!
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Hey there!

    When stuff like that happens to me, I yield to the documentation of the software being used, so I would say grab your oracle 10g doc and read it a bit see what you have. You probably need something more concrete but, if your upload is at least working, there must be a reason why you are limited to only the size mentioned...

    Give that a go, and tell if that worked.

    In a bit!

    Comment

    Working...