• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

file upload in spring boot using thymeleaf, java api, mysql

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to spring boot. saw your you tube video on the file upload. i am working on a project of my own. i want to implement the upload file to add photos. i am trying to make the code work, but there are errors. if someone could help, that will be very helpful.
i want to to use the current method in the controller to utilize the file upload as well, but it comes up with the following error in spring boot. i need guidance to set up the method parameters/arguments so that it will accept the image file name and pass to the parameters inside the method and then want to test the incoming file name in the view. later will test the file save portion in the sql db.
i am using springboot/thymeleaf/hibernate jpa. mysql is set up to accept the incoming longblob.
not using jsp.
--------------------------------
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed May 17 18:36:58 EDT 2017
There was an unexpected error (type=Unsupported Media Type, status=415).
Content type 'null' not supported
---------------------------------------



-----------html code----------


<form method="post" enctype="multipart/form-data">

<input type="file" name="file" id="file" accept="image/*"/>


</form>



 
shaikh russell
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shaikh russell wrote:I am new to spring boot. saw your you tube video on the file upload. i am working on a project of my own. i want to implement the upload file to add photos. i am trying to make the code work, but there are errors. if someone could help, that will be very helpful.
i want to to use the current method in the controller to utilize the file upload as well, but it comes up with the following error in spring boot. i need guidance to set up the method parameters/arguments so that it will accept the image file name and pass to the parameters inside the method and then want to test the incoming file name in the view. later will test the file save portion in the sql db.
i am using springboot/thymeleaf/hibernate jpa. mysql is set up to accept the incoming longblob.
not using jsp.
--------------------------------
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed May 17 18:36:58 EDT 2017
There was an unexpected error (type=Unsupported Media Type, status=415).
Content type 'null' not supported
---------------------------------------



-----------html code----------


<form method="post" enctype="multipart/form-data">

<input type="file" name="file" id="file" accept="image/*"/>


</form>





Image-31.jpg
[Thumbnail for Image-31.jpg]
 
reply
    Bookmark Topic Watch Topic
  • New Topic