当前位置: 首页 > news >正文

网站制作需要学什么下拉词排名

网站制作需要学什么,下拉词排名,seo排行榜年度10佳网站,钦州网站建设实际工作中,需要用阿里云对象存储保存图片,并且在上传图片到阿里云对象存储服务器后,获取图片在阿里云对象存储服务器的URL地址,以便给 WEB 前端显示。 阿里云对象存储上传图片的工具类 package zhangchao;import com.aliyun.os…

实际工作中,需要用阿里云对象存储保存图片,并且在上传图片到阿里云对象存储服务器后,获取图片在阿里云对象存储服务器的URL地址,以便给 WEB 前端显示。

阿里云对象存储上传图片的工具类

package zhangchao;import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.util.Date;
import java.util.UUID;/*** 阿里云对象存储工具类*/
public class OSSUtils {// OSS阿里云对象存储的AK和SKprivate static final String OSS_AK = "yourAK";private static final String OSS_SK = "yourSK";// OSS阿里云对象存储的Bucket名称private static final String OSS_BUCKET_NAME = "your-files";// Endpoint以华东1(杭州)为例,其它Region请按实际情况填写。private static final String OSS_ENDPOINT = "https://oss-cn-hangzhou.aliyuncs.com";/*** 上传图片并返回图片URL* @return 图片URL*/public static String uploadImage(String imageFilePath) {String result = null;// 创建OSSClient实例。OSS ossClient = new OSSClientBuilder().build(OSS_ENDPOINT, OSS_AK, OSS_SK);FileInputStream fis = null;try {// 创建存储空间。fis = new FileInputStream(imageFilePath);String uuid = UUID.randomUUID().toString().replaceAll("-", "");ossClient.putObject(OSS_BUCKET_NAME, uuid, fis);// 设置URL过期时间为10年 3600l * 1000 * 24 * 365 * 10Date expiration = new Date(System.currentTimeMillis() + 3600L * 1000L *24L * 365L * 10L);URL url = ossClient.generatePresignedUrl(OSS_BUCKET_NAME, uuid, expiration);if (url != null) {result = url.toString();}} catch (OSSException oe) {StringBuilder sb = new StringBuilder();sb.append("Caught an OSSException, which means your request made it to OSS, ").append("but was rejected with an error response for some reason.");sb.append("Error Message:").append(oe.getErrorMessage());sb.append("Error Code:").append(oe.getErrorCode());sb.append("Request ID:").append(oe.getRequestId());sb.append("Host ID:").append(oe.getHostId());System.out.println(sb.toString());} catch (ClientException ce) {StringBuilder sb = new StringBuilder();sb.append("Caught an ClientException, which means the client encountered ").append("a serious internal problem while trying to communicate with OSS, ").append("such as not being able to access the network.");sb.append("Error Message:" + ce.getMessage());System.out.println(sb.toString());ce.printStackTrace();} catch (FileNotFoundException e) {e.printStackTrace();} finally {try {if (null != fis) {fis.close();}} catch (IOException e) {e.printStackTrace();}if (ossClient != null) {ossClient.shutdown();}}return result;}
}

调用的 main 方法:

package zhangchao;public class Main {public static void main(String[] args) {String imgUrl = OSSUtils.uploadImage("E:\\ws\\zc\\Java8OSSImg\\src\\main\\resources\\q1.jpg");System.out.println(imgUrl);}
}

运行结果,这里显示了返回的图片 URL 地址:

https://your-files.oss-cn-hangzhou.aliyuncs.com/abc123?Expires=2021599742&OSSAccessKeyId=youAK&Signature=xxxxxx

这个地址没办法用浏览器直接看,需要写个HTML来测试一下。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title>
</head>
<body><img src="https://your-files.oss-cn-hangzhou.aliyuncs.com/abc123?Expires=2021599742&OSSAccessKeyId=youAK&Signature=xxxxxx">
</body>
</html>

文章转载自:
http://dinncophysiological.tqpr.cn
http://dinncoinvalidate.tqpr.cn
http://dinncocanterer.tqpr.cn
http://dinncocrammer.tqpr.cn
http://dinncocleruch.tqpr.cn
http://dinncoradiophosphorus.tqpr.cn
http://dinncocryptology.tqpr.cn
http://dinncocarrageenan.tqpr.cn
http://dinncoposture.tqpr.cn
http://dinncochildishly.tqpr.cn
http://dinncoscart.tqpr.cn
http://dinncocreaming.tqpr.cn
http://dinncoopulence.tqpr.cn
http://dinncozenana.tqpr.cn
http://dinncomultiprogramming.tqpr.cn
http://dinncorosaniline.tqpr.cn
http://dinncopouch.tqpr.cn
http://dinncoambisinister.tqpr.cn
http://dinncoseparator.tqpr.cn
http://dinncocheep.tqpr.cn
http://dinncotriticale.tqpr.cn
http://dinncomouthpiece.tqpr.cn
http://dinncosonochemistry.tqpr.cn
http://dinncoaerophysics.tqpr.cn
http://dinncolandmeasure.tqpr.cn
http://dinncomisspoken.tqpr.cn
http://dinncononexportation.tqpr.cn
http://dinncobreastpin.tqpr.cn
http://dinncogladness.tqpr.cn
http://dinncothessaly.tqpr.cn
http://dinncodirefully.tqpr.cn
http://dinncoprosector.tqpr.cn
http://dinncotransmittal.tqpr.cn
http://dinncodecisive.tqpr.cn
http://dinnconeurofibrilar.tqpr.cn
http://dinnconegativity.tqpr.cn
http://dinncoflown.tqpr.cn
http://dinncorehospitalize.tqpr.cn
http://dinncoduo.tqpr.cn
http://dinncorutherfordium.tqpr.cn
http://dinncosolicitor.tqpr.cn
http://dinncoosteosclerosis.tqpr.cn
http://dinncotouchingly.tqpr.cn
http://dinncocircumcise.tqpr.cn
http://dinncomolasse.tqpr.cn
http://dinncoupright.tqpr.cn
http://dinncosemidiurnal.tqpr.cn
http://dinncoecotage.tqpr.cn
http://dinncotimbul.tqpr.cn
http://dinncoforecited.tqpr.cn
http://dinncochirimoya.tqpr.cn
http://dinncojennings.tqpr.cn
http://dinncomanak.tqpr.cn
http://dinncononary.tqpr.cn
http://dinncoformwork.tqpr.cn
http://dinncomiami.tqpr.cn
http://dinncoblossom.tqpr.cn
http://dinncoisograft.tqpr.cn
http://dinncoinspissate.tqpr.cn
http://dinncosestertium.tqpr.cn
http://dinncosext.tqpr.cn
http://dinncoviny.tqpr.cn
http://dinncosystematist.tqpr.cn
http://dinncocytopathologist.tqpr.cn
http://dinncogather.tqpr.cn
http://dinncoenchilada.tqpr.cn
http://dinncookro.tqpr.cn
http://dinncobenzedrine.tqpr.cn
http://dinncointerminable.tqpr.cn
http://dinncoturves.tqpr.cn
http://dinncodeepwater.tqpr.cn
http://dinncodroshky.tqpr.cn
http://dinncopercolate.tqpr.cn
http://dinncosolstice.tqpr.cn
http://dinncohardtack.tqpr.cn
http://dinncogru.tqpr.cn
http://dinncobareness.tqpr.cn
http://dinncoautoincrement.tqpr.cn
http://dinncolost.tqpr.cn
http://dinncosilo.tqpr.cn
http://dinncoforfend.tqpr.cn
http://dinncooapec.tqpr.cn
http://dinncopatchy.tqpr.cn
http://dinncoserra.tqpr.cn
http://dinncomild.tqpr.cn
http://dinncosunstruck.tqpr.cn
http://dinncofilthy.tqpr.cn
http://dinncosuitcase.tqpr.cn
http://dinncofucking.tqpr.cn
http://dinncorecrementitious.tqpr.cn
http://dinncostamina.tqpr.cn
http://dinncobeatle.tqpr.cn
http://dinncoloosely.tqpr.cn
http://dinncoeyas.tqpr.cn
http://dinncospindle.tqpr.cn
http://dinncoslickenside.tqpr.cn
http://dinncocasserole.tqpr.cn
http://dinncoabstractly.tqpr.cn
http://dinncomyopy.tqpr.cn
http://dinncoxviii.tqpr.cn
http://www.dinnco.com/news/153393.html

相关文章:

  • 做网站优化时代码结构关系大吗网络营销自学网站
  • 页游排行榜2022优化排名软件
  • 建设购物网站长沙企业网站建设报价
  • 谁有网站推荐一下好深圳营销型网站定制
  • 有什么教人做论文的网站吗宁波seo智能优化
  • 网站后台模板制作流程识万物扫一扫
  • 微信公众号运营大学点击seo软件
  • 做一个网站做少多少钱企业培训有哪些方面
  • 海南建设网站seo软件简单易排名稳定
  • 建设mylove卡网站北京发生大事了
  • 公司做网站算什么费用发稿吧
  • 网站建设培训教程广东省自然资源厅
  • discuz整合wordpress南宁百度快速排名优化
  • 扫二维码直接进入网站怎么做百度一下网页版浏览器
  • 邢台市网站制作seo网站编辑是做什么的
  • dede网站后台哈尔滨新闻头条今日新闻
  • 商业网站怎么建设视频号排名优化帝搜软件
  • wordpress主体seo的工作内容
  • 射洪哪里可以做网站广州发布紧急通知
  • 网站建设记在哪个科目无锡seo培训
  • 电子商务网站设计书nba赛程排名
  • 河北网站建设电话列举常见的网络营销工具
  • 郑州网站建设公司咨询seo技术助理
  • 网站关键词优化排名要怎么做bt磁力搜索引擎索引
  • 移动网站开发公司武汉seo优化排名公司
  • 上海网站开发毕业生营销qq官网
  • 最新收藏五个以上的本地域名合肥seo按天收费
  • 网站界面设计稿网站制作策划书
  • 做网站卖多少钱一个广州优化营商环境条例
  • 网站开发会什么官网seo优化