Windows环境下用C#编程将文件上传至阿里云OSS笔记

 Windows环境下用C#编程将文件上传至阿里云OSS笔记

本系列文章由ex_net(张建波)编写,转载请注明出处。


http://blog.csdn.net/ex_net/article/details/24962567


作者:张建波 邮箱: 281451020@qq.com  欢迎来信交流!



第1步:

    下载阿里云OSS的SDK包,因为笔者的环境是PHP服务,所下面载的是PHP的SDK包

     http://help.aliyun.com/view/13438816.html


第2步:将代码整合进你的站点或服务中。



第3步:配置OSS訪问接口

      (1)找到conf.inc.php文件,改动ACCESS_ID和ACCESS_KEY



     说明:ACCESS_ID和ACCES_KEY,能够在阿里云的后台控制管理页面找到




第4步:找到demo文件夹下的upload.php文件

适当改动,就能够了。

改动

function upload_by_content($obj) 

{

}

感兴趣的朋友能够依据自己的需求进行改动。假设不改动,能够用这个html代码測试

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<form action="upload.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <label for="userfile"></label>
  <input type="file" name="userfile" id="userfile" />
  <input type="submit" name="button" id="button" value="提交" />
</form>
</body>
</html>


因为C#程序代码过于复杂,就不在这里介绍了。假设有这方面开发需求的朋友,能够邮件联系我。


这是笔者开发的一个C#控件






原文地址:https://www.cnblogs.com/mfrbuaa/p/3854928.html