Reputation: 609
I have a normal file upload code in HTML page through which I will upload a file. The problem is I am using the complete file URL later in my Servlet. In Firefox there is a textbox in which complete URL is coming, so my application works fine there, but in Chrome only the file name with extension is coming, so the file is not uploading the file.
If I am not clear in language, then open this link in both Chrome and Firefox and observe.
Is there any solution so I can use the URL(imagepath) in chrome also??
Upvotes: 1
Views: 1065
Reputation: 689
You cannot get the path of a file from your local system from any modern browser except IE because of security reasons. Only the file name is returned. It's the business of none of the websites to track from which local location the file is coming from. You have many ways to upload a file onto the server, regardless of where it is in the local file system.
Upvotes: 1