The requirement is to write a method to upload the uploaded files to Alibaba Cloud oss
First, familiarize yourself with the method of uploading to local:
Java file upload_a blog that forgets the name-CSDN blog
Then take a look at how to upload files to Alibaba Cloud:
Alibaba Cloud API documentation:
How to use OSSJavaSDK to complete common operations_Object Storage-Alibaba Cloud Help Center
Then look at the examples written by others:
File upload and OSS upload to Alibaba Cloud_GG-0408's blog-CSDN blog
Just imitate and write one. If you don’t understand, you can check out the following links:
After reading it, I understood everything:
Getting Started with Alibaba Cloud OSS_bucketname_Lu Xiaoyang's Blog-CSDN Blog
Alibaba Cloud OSS Object Storage Service_ossclient.putobject_A Salty Fish Qin’s Blog-CSDN Blog