Announcement Announcement Module
Collapse
No announcement yet.
File upload via Spring MVC API+ Jquery based Front END HTML Web App Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • File upload via Spring MVC API+ Jquery based Front END HTML Web App

    Hello all,

    I wish to upload a file using a Spring MVC based REST API. The API will be a typical Java web app and will act as the backend.

    The frontend will be a HTML web app that uses JQuery.

    I want to show an upload box using which user can select the file to be uploaded. Now this file has to be passed as parameter to the API so that it can be stored by the API.

    These are my questions--

    (1) In the service class I am thinking of passing a File object as parameter. However how do I connect the file being uploaded with this file object input parameter? Am I correct in thinking like this, or is there some other approach to do this?

    (2) In case my suggested method works and there are other ways also of achieving the same thing, which method would you recommend for such a scenario- if you can point me to a tutorial/guide/how to explaining how to upload a file as per above scenario, or explain it yourself-- that would be very helpful for me.

    Thanks,
    Arvind.
Working...
X