• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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]
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!