Spring boot upload files with multiple parameter
How do i upload file with multiple parameter in spring boot in submit form
Thanks in advance
17 Replies
⌛ This post has been reserved for your question.
Hey @1howard1.! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
u trying to create apis ryt ?
Simple input form
A lot of things in google doesnt work as expected
multiple parameters as in file has multiple parameters or the request has multiple parameters
Both multiple files with multiple parameter
i mean you can just make a request param for files
and make it
MultipartFile[]
as param type
Several sources i saw nothing works
show
Imma send u 2 hours from now
Im not infront of my laptop
This message has been formatted automatically. You can disable this using
/preferences.package com.example.demo.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.util.StringUtils;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Objects;
import com.example.demo.Entity.BarangEntity;
import com.example.demo.Repository.BarangRepo;
@Service
this is service
This message has been formatted automatically. You can disable this using
/preferences.those are not files at least from what i read
here
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.