•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 455,962 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,578 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 774 | Replies: 3
![]() |
•
•
Join Date: Oct 2007
Posts: 25
Reputation:
Rep Power: 0
Solved Threads: 0
hi,
Iam using tomca,mysql.In my appl ,i wrote a code to upload an image using jps.its working fine in my system.But wen i access my appl from another system(in LAN),iam unable to upload the image.p[lz tell me wats wrong in my code
PreparedStatement st=con.prepareStatement("update login set photo=? where uid=?");
File f=new File(request.getParameter("photo"));
InputStream fis=new FileInputStream(f);
st.setBinaryStream(1,fis,(int)f.length());
st.setString(2,request.getParameter("t1"));
st.setString(2,session.getAttribute("uid").toString());
st.executeUpdate();
the error showing is
///
HTTP Status 404 - D:\Documents and Settings\Administrator.TARKA-9\Desktop\New Folder\images\top_links_left_corner.jpg (The system cannot find the path specified)
--------------------------------------------------------------------------------
type Status report
message D:\Documents and Settings\Administrator.TARKA-9\Desktop\New Folder\images\top_links_left_corner.jpg (The system cannot find the path specified)
description The requested resource (D:\Documents and Settings\Administrator.TARKA-9\Desktop\New Folder\images\top_links_left_corner.jpg (The system cannot find the path specified)) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.4
///
plz help thank u in advance
Iam using tomca,mysql.In my appl ,i wrote a code to upload an image using jps.its working fine in my system.But wen i access my appl from another system(in LAN),iam unable to upload the image.p[lz tell me wats wrong in my code
PreparedStatement st=con.prepareStatement("update login set photo=? where uid=?");
File f=new File(request.getParameter("photo"));
InputStream fis=new FileInputStream(f);
st.setBinaryStream(1,fis,(int)f.length());
st.setString(2,request.getParameter("t1"));
st.setString(2,session.getAttribute("uid").toString());
st.executeUpdate();
the error showing is
///
HTTP Status 404 - D:\Documents and Settings\Administrator.TARKA-9\Desktop\New Folder\images\top_links_left_corner.jpg (The system cannot find the path specified)
--------------------------------------------------------------------------------
type Status report
message D:\Documents and Settings\Administrator.TARKA-9\Desktop\New Folder\images\top_links_left_corner.jpg (The system cannot find the path specified)
description The requested resource (D:\Documents and Settings\Administrator.TARKA-9\Desktop\New Folder\images\top_links_left_corner.jpg (The system cannot find the path specified)) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.4
///
plz help thank u in advance
Bala Gangadhar Marripeedi m.balagangadhar@gmail.com
It has nothing to do with the JDBC code (excpet for where it opens the file), and everything to do with how you are retreiving the file. Seemingly, according to the error messages, you are not uploading a file into the db, but simply saving a local file into the db.
You should not be attempting to open a file. The file upload request contains the file, you should be using the inputstream from the request, n ot attempting to open a file.
You should not be attempting to open a file. The file upload request contains the file, you should be using the inputstream from the request, n ot attempting to open a file.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Look into the Apache File Upload module to ease the task of file uploads.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Uploading an image into a Jpanel (Java)
- mpeg uploading (Ruby)
- Uploading Image in freetext box dll (ASP.NET)
- check for images duplication (ASP.NET)
- thumbnail from pdf file (ASP)
- uploading image in database (PHP)
Other Threads in the Java Forum
- Previous Thread: Game algorithm help
- Next Thread: Help(polymorphic variables in java)



Linear Mode