Search code examples
jspfile-uploadstruts

how to upload file to the server by specifying only the local path in the computer


Currently I am using JSP and Struts to build a website. There is a requirement that user can upload a file by just typing in the local path of the file. When submitting the local path of the file, server will automatically retrieve the file and upload it. Is it possible to achieve this goal?


Solution

  • All you can do is to ask the client to supply you with the file. You cannot simply make the server retrieve a file from a client, as the client does not expose its file system.

    For file uploads using JSPs refer to: http://www.tutorialspoint.com/jsp/jsp_file_uploading.htm

    I hope this could help, please specify your problem in more detail if you need further input.

    You could also be interessted in: https://blueimp.github.io/jQuery-File-Upload/basic.html