Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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]
 
There's a city wid manhunt for this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic