[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Paul Clapham wrote:Okay. So that says the file you asked for can't be found. The error message gives you the full path to the file you asked for, so you should be able to confirm that quite easily.
But this whole thread confuses me. You started out by displaying some screenshots where you were asking for a file name and path (I think). And then suddenly you switched to asking a question about a servlet running in a Tomcat server which is trying to read a file from the server. I don't understand how the two things are connected.
It almost looks like you're making the typical beginner mistake about file uploads where you try to just send the client's file path instead of sending the contents of the file, and expect the server to be able to read the data from the client. But then you didn't say anything about what the purpose of your code was, so it's a mystery.
Sarra Sakka wrote:Well, I created a web page that only an administrator can connect.
The administrator connects to its own mahine, and can handle the addition and deletion of classes remotely.
For me, I just Volut retrieve the path of the image chosen.
Ulf Dittmer wrote:1) Is "C:\Users\Sarra\workspace_new\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Gestion de stock\ImagePath" an existing file or directory?
1a) If yes, does the user account under which the servlet container is run have access rights to it?
1b) If not, why is the code trying to access it?
2) It seems a bad idea to muck around with files somewhere deep inside Eclipse's directory hierarchy. (I also think it's not a good idea to run the servlet container inside of an IDE - I advise to switch to a standalone servlet container instead.)
Sarra Sakka wrote:
How can i do this ?Ulf Dittmer wrote:I advise to switch to a standalone servlet container instead.)
Ulf Dittmer wrote:If by "path of image chosen" you mean the client-side path to the image chosen during the HTML file upload, then that is not possible, period. Browsers send the file name, not the path. You will have to come up with a different design.
This entire discussion seems to have been about storing a path in the DB, but the schema doesn't have one?
Why would you care where it was stored on the client?
The image gets uploaded, and then stored by your code wherever it makes sense on the server
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|