excel oss 上传_springboot上传excel到oss

这是一个关于如何使用SpringBoot上传Excel文件到阿里云OSS(Object Storage Service)的示例代码,涉及到OSSClient的使用,文件元数据设置以及文件名的生成策略。此外,还提供了获取地区信息的API接口。
摘要由CSDN通过智能技术生成

Demo如下:

package com.ztkj.engine.portal.controller;

import com.aliyun.oss.OSSClient;

import com.aliyun.oss.model.ObjectMetadata;

import com.ztkj.engine.common.result.Response;

import com.ztkj.engine.portal.entity.bean.Region;

import com.ztkj.engine.portal.service.RegionService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.annotation.Value;

import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.bind.annotation.RestController;

import org.springframework.web.multipart.commons.CommonsMultipartFile;

import java.text.SimpleDateFormat;

import java.util.Calendar;

import java.util.HashMap;

import java.util.Map;

import java.util.UUID;

/**

* 版本 开发者 创建日期

* 1.0.0 InetCommunity(^_^)on 2018/12/25.

*/

@RestController

@RequestMapping("/common")

public class CommonController {

@Value("${OSS.BUCKET_NAME}")

private String BUCKET_NAME;

@Value("

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值