编程导航七牛云话题讨论

七牛云

3 参与
分享

快来分享你的内容吧~

点击登录,快来和大家讨论吧~
表情
图片
话题
打卡
综合
交流
文章
问答

关于七牛云测试域名过期如何下载图片资源

大家都知道,七牛云的测试域名是只有30天的有效时间,那如果在过期之前没有将里面的图片、文件资源下载保存下载,在过期之后是没办法访问了的,也没办法下载,所以该如何解决这个问题呢?其实也很简单: 先说结论:有两种办法: 第一种办法是: - **重新创建一个测试bucket(会分配一个新的测试域名)** - **batchcopy 原bucket到新的bucket** - **qdownload 新bucket** 第二种办法是:**用一个已经ICP备案的域名绑定到测试域名** 第二种办法很简单,我们主要是讲第一种办法: 1. 首先在七牛云控制台新建空间 使用浏览器进入七牛云控制台,在对象存储中新建一个存储空间,此存储空间需要与失效的存储空间在同一个【存储区域】上(比如都在华南,不在同一存储区域无法拷贝)。 2. 接下来需要到七牛云官方的工具:http://devtools.qiniu.com/qshell-v2.3.5.zip 或 http://devtools.qiniu.com/qshell-v2.2.0.zip (注意版本是2.2.0跟2.3.5命令上会有些许差异)将qshell工具下载下来并解压,然后在该文件夹下shift+右键,然后点击powershell工具,之后都需要在该工具上操作。命令格式: ```bash # CMD 命令格式 qshell.exe 命令 参数 # Git Bash 等类 Linux 终端命令格式 ./qshell.exe 命令 参数 ``` 首先设置权限: ```bash # qshell-2.3.5 版本命令 ./qshell.exe account <AccessKey> <SecretKey> <Name> # qshell-2.2.0 版本命令 ./qshell.exe account <AccessKey> <SecretKey> ``` Name是用户可以任意取的名字,表示当前在本地记录的账户的名称,和在七牛注册的邮箱信息没有关系。 到七牛云上将你的AK跟SK复制下来并粘贴到对应的位置(注意版本的命令区别) 3. 接下来我们需要将测试域名以失效的存储空间的文件全部下载下来: 第一步、获取失效之前所有文件的文件名称跟所在位置: 使用 listbucket 导出文件列表 参考官方网址:https://github.com/qiniu/qshell/blob/master/docs/listbucket.md 假设失效存储空间名为:bucketOld 假设新建存储空间名为:bucketNew ```bash # qshell-2.3.5 版本命令 ./qshell.exe listbucket bucketOld -o list.txt # qshell-2.2.0 版本命令 ./qshell.exe listbucket bucketOld list.txt ``` 执行完这个命令之后你就会得到以下list.txt: ```txt article/f9664d0bd47bbb502c14c2420246a340.png 11706 FuvcYD6QQw1TcANknPFCmi86OJCD 17186775691431600 image/png 0 0 article/fa3e3231dfcb012343f84d0b02d508a3.png 40538 FldsQD454DL5xLQkvtOaHBsCPylm 17186776491948051 image/png 0 0 avatar/9018b3dc44f1e2da12dfde378753cb94.png 48490 FpvbPzSchDW9mA3lmqNxkQymLtCj 17184355046082066 image/png 0 0 avatar/9f3b876e75f7a774e721345075f2c276.png 62916 FkZnnuoRjhE2svzozWLKmdViStyv 17217070727051088 image/png 0 0 avatar/be866f1db235cdbda21233a726febcd6.png 76881 FsdKu_ZBBhuqHBqgPX0eP37iQnse 17167098700699907 image/png 0 0 avatar/f3119cdd91f133db2dd0de3f6bfb239a.png 69552 Fuly-xMo6HSjkot7C-JvQ3S1Cd5b 17185281870586719 image/png 0 0 b52b69ebc94dc7d678a5b326123123123123.png 1266967 FsizXr4T1brNMWvty68TK99axGJq 17210260019895521 image/png 0 0 config/5169640109761800878d8045dcaadc50.jpg 144630 FhkG5MscidUTwRCKC-2B2vmcR05x 17167106799891168 image/jpeg 0 0 config/b52b69ebc94dc7d678a5b326ee8a084c.jpg 201844 FhOF8VMxCa-DW91Zx7Mweo8u7ZOV 17167107050184185 image/jpeg 0 0 pic/ 0 Fto5o-5ea0sNMlW_75VgGJCv2AcJ 17167053968790631 application/qiniu-object-manager 0 0 pic/backgroundPicture.jpg 2028369 FqzbMRbJfDZbtpWSAmdMnJT6Df4O 17167054250151036 image/jpeg 0 0 pic/bg.png 308607 FhRXnQmj6Kzqu5ALEzlhRWCv3mjS 17167054245920843 image/png 0 0 ``` 然后我们需要手动删除多余的数据,只留下文件名, 如: ```txt article/0a1dd363cd6b816bbb0353a290938b26.png article/5b0b5cd27e95df8b1a1d8731783936cf.png article/667280f7a7f5d9f182e6bbf634733dc2.png b52b69ebc94dc7d678a5b326123123123123.png config/5169640109761800878d8045dcaadc50.jpg config/6208a2e291c4473af7f97647b7c99739.png config/7b854aaec8f70f85e27a887aec971a93.jpg config/8685fce4857fc55031513ecf4e54218e.jpg config/b52b69ebc94dc7d678a5b326ee8a084c.jpg pic/ pic/backgroundPicture.jpg pic/bg.png ``` 然后保存文件 接下来就可以通过命令将旧文件复制到新文件上去了: ```bash # qshell-2.3.5 版本命令 ./qshell.exe batchcopy --force --overwrite bucketOld bucketNew -i list.txt # qshell-2.2.0 版本命令 ./qshell.exe batchcopy --force --overwrite bucketOld bucketNew list.txt ``` 之后你就会在你新建的测试存储空间看到这些已经存在的文件了,然后就可以通过qdownload将其下载下来(qdownload无需下载):参考官方网址:https://github.com/qiniu/qshell/blob/master/docs/qdownload.md ```bash # qshell-2.2.0 与 qshell-2.3.5 版本命令相同 ./qshell.exe qdownload download.conf ``` download.conf文件的内容如下: ```json { "dest_dir" : "D:\\img\\", "bucket" : "bucketNew", "cdn_domain" : "xxxxxx.bkt.clouddn.com" } ``` |参数名|描述| |----|----| |dest_dir|本地数据备份路径,为全路径,并且文件夹需要事先创建好,不然无法下载| |bucket|空间名称| |cdn_domain|设置下载的CDN域名,此处为新建空间的测试域名。| 备注: 在Windows系统下面使用的时候,注意dest_dir的设置遵循D:\\\aaa\\\bbb这种方式。也就是路径里面的要有两个(\)。 在默认不指定cdn_domain的情况下,会从存储源站下载资源,这部分下载产生的流量会生成存储源站下载流量的计费,请注意,这部分计费不在七牛CDN免费10G流量覆盖范围。 **特别注意,在执行命令的时候不一定是qshell.exe,有可能是qshell-windows-x64.exe。**

关于七牛云测试域名过期如何下载图片资源

<html> <head></head> <body> <div class="content ql-editor"> <p><span style="background-color: unset; color: unset;">大家都知道,七牛云的测试域名是只有30天的有效时间,那如果在过期之前没有将里面的图片、文件资源下载保存下载,在过期之后是没办法访问了的,也没办法下载,所以该如何解决这个问题呢?其实也很简单:</span></p> <p><span style="background-color: unset; color: unset;">先说结论:有两种办法:</span></p> <p><span style="background-color: unset; color: unset;">第一种办法是:</span></p> <p><strong style="background-color: unset; color: unset;">重新创建一个测试bucket(会分配一个新的测试域名)</strong></p> <p><strong style="background-color: unset; color: unset;">batchcopy 原bucket到新的bucket</strong></p> <p><strong style="background-color: unset; color: unset;">qdownload 新bucket</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">第二种办法是:</span><strong style="background-color: unset; color: unset;">用一个已经ICP备案的域名绑定到测试域名</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">第二种办法很简单,我们主要是讲第一种办法:</span></p> <p><span style="background-color: unset; color: unset;">1. 首先在七牛云控制台新建空间</span></p> <p><span style="background-color: unset; color: unset;">使用浏览器进入七牛云控制台,在对象存储中新建一个存储空间,此存储空间需要与失效的存储空间在同一个【存储区域】上(比如都在华南,不在同一存储区域无法拷贝)。</span></p> <p><span style="background-color: unset; color: unset;">2. 接下来需要到七牛云官方的工具:</span><a href="http://devtools.qiniu.com/qshell-v2.3.5.zip" target="_blank" style="background-color: unset; color: unset;">http://devtools.qiniu.com/qshell-v2.3.5.zip</a><span style="background-color: unset; color: unset;"> 或 </span><a href="http://devtools.qiniu.com/qshell-v2.2.0.zip" target="_blank" style="background-color: unset; color: unset;">http://devtools.qiniu.com/qshell-v2.2.0.zip</a><span style="background-color: unset; color: unset;"> (注意版本是2.2.0跟2.3.5命令上会有些许差异)将qshell工具下载下来并解压,然后在该文件夹下shift+右键,然后点击powershell工具,之后都需要在该工具上操作。命令格式:</span></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># CMD 命令格式</strong></p> <p><strong style="background-color: unset; color: unset;">qshell.exe 命令 参数</strong></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># Git Bash 等类 Linux 终端命令格式</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe 命令 参数</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">首先设置权限:</span></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># qshell-2.3.5 版本命令</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe account &lt;AccessKey&gt; &lt;SecretKey&gt; &lt;Name&gt;</strong></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># qshell-2.2.0 版本命令</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe account &lt;AccessKey&gt; &lt;SecretKey&gt;</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">Name是用户可以任意取的名字,表示当前在本地记录的账户的名称,和在七牛注册的邮箱信息没有关系。</span></p> <p><span style="background-color: unset; color: unset;">到七牛云上将你的AK跟SK复制下来并粘贴到对应的位置(注意版本的命令区别)</span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">3. 接下来我们需要将测试域名以失效的存储空间的文件全部下载下来:</span></p> <p><span style="background-color: unset; color: unset;">第一步、获取失效之前所有文件的文件名称跟所在位置:</span></p> <p><span style="background-color: unset; color: unset;">使用 listbucket 导出文件列表 参考官方网址:</span><a href="https://github.com/qiniu/qshell/blob/master/docs/listbucket.md" target="_blank" style="background-color: unset; color: unset;">https://github.com/qiniu/qshell/blob/master/docs/listbucket.md</a></p> <p><span style="background-color: unset; color: unset;">假设失效存储空间名为:bucketOld</span></p> <p><span style="background-color: unset; color: unset;">假设新建存储空间名为:bucketNew</span></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># qshell-2.3.5 版本命令</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe listbucket bucketOld -o list.txt</strong></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># qshell-2.2.0 版本命令</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe listbucket bucketOld list.txt</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">执行完这个命令之后你就会得到以下list.txt:</span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">article/f9664d0bd47bbb502c14c2420246a340.png 11706 FuvcYD6QQw1TcANknPFCmi86OJCD 17186775691431600 image/png 0 0 </span></p> <p><span style="background-color: unset; color: unset;">article/fa3e3231dfcb012343f84d0b02d508a3.png 40538 FldsQD454DL5xLQkvtOaHBsCPylm 17186776491948051 image/png 0 0 </span></p> <p><span style="background-color: unset; color: unset;">avatar/9f3b876e75f7a774e721345075f2c276.png 62916 FkZnnuoRjhE2svzozWLKmdViStyv 17217070727051088 image/png 0 0 </span></p> <p><span style="background-color: unset; color: unset;">config/b52b69ebc94dc7d678a5b326ee8a084c.jpg 201844 FhOF8VMxCa-DW91Zx7Mweo8u7ZOV 17167107050184185 image/jpeg 0 0 </span></p> <p><span style="background-color: unset; color: unset;">pic/ 0 Fto5o-5ea0sNMlW_75VgGJCv2AcJ 17167053968790631 application/qiniu-object-manager 0 0 </span></p> <p><span style="background-color: unset; color: unset;">pic/backgroundPicture.jpg 2028369 FqzbMRbJfDZbtpWSAmdMnJT6Df4O 17167054250151036 image/jpeg 0 0 </span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">然后我们需要手动删除多余的数据,只留下文件名, 如:</span></p> <p><span style="background-color: unset; color: unset;"><br></span></p> <p><span style="background-color: unset; color: unset;">article/0a1dd363cd6b816bbb0353a290938b26.png</span></p> <p><span style="background-color: unset; color: unset;">article/5b0b5cd27e95df8b1a1d8731783936cf.png</span></p> <p><span style="background-color: unset; color: unset;">config/7b854aaec8f70f85e27a887aec971a93.jpg</span></p> <p><span style="background-color: unset; color: unset;">config/8685fce4857fc55031513ecf4e54218e.jpg</span></p> <p><span style="background-color: unset; color: unset;">config/b52b69ebc94dc7d678a5b326ee8a084c.jpg</span></p> <p><span style="background-color: unset; color: unset;">pic/</span></p> <p><span style="background-color: unset; color: unset;">pic/backgroundPicture.jpg</span></p> <p><span style="background-color: unset; color: unset;"><br></span></p> <p><span style="background-color: unset; color: unset;">然后保存文件</span></p> <p><span style="background-color: unset; color: unset;">接下来就可以通过命令将旧文件复制到新文件上去了:</span></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># qshell-2.3.5 版本命令</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe batchcopy --force --overwrite bucketOld bucketNew -i list.txt</strong></p> <p><br></p> <p><strong style="background-color: unset; color: unset;"># qshell-2.2.0 版本命令</strong></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe batchcopy --force --overwrite bucketOld bucketNew list.txt</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">之后你就会在你新建的测试存储空间看到这些已经存在的文件了,然后就可以通过qdownload将其下载下来(qdownload无需下载):参考官方网址:</span><a href="https://github.com/qiniu/qshell/blob/master/docs/qdownload.md" target="_blank" style="background-color: unset; color: unset;">https://github.com/qiniu/qshell/blob/master/docs/qdownload.md</a></p> <p><br></p> <p><span style="background-color: unset; color: unset;"># qshell-2.2.0 与 qshell-2.3.5 版本命令相同</span></p> <p><strong style="background-color: unset; color: unset;">./qshell.exe qdownload download.conf</strong></p> <p><br></p> <p><span style="background-color: unset; color: unset;">download.conf文件的内容如下:</span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">{</span></p> <p><span style="background-color: unset; color: unset;"> "dest_dir" : "D:\\img\\",</span></p> <p><span style="background-color: unset; color: unset;"> "bucket" : "bucketNew",</span></p> <p><span style="background-color: unset; color: unset;"> "cdn_domain" : "xxxxxx.bkt.clouddn.com"</span></p> <p><span style="background-color: unset; color: unset;">}</span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">|参数名|描述|</span></p> <p><span style="background-color: unset; color: unset;">|----|----|</span></p> <p><span style="background-color: unset; color: unset;">|dest_dir|本地数据备份路径,为全路径,并且文件夹需要事先创建好,不然无法下载|</span></p> <p><span style="background-color: unset; color: unset;">|bucket|空间名称|</span></p> <p><span style="background-color: unset; color: unset;">|cdn_domain|设置下载的CDN域名,此处为新建空间的测试域名。|</span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">备注:</span></p> <p><br></p> <p><span style="background-color: unset; color: unset;">在Windows系统下面使用的时候,注意dest_dir的设置遵循D:\\aaa\\bbb这种方式。也就是路径里面的要有两个(\)。</span></p> <p><span style="background-color: unset; color: unset;">在默认不指定cdn_domain的情况下,会从存储源站下载资源,这部分下载产生的流量会生成存储源站下载流量的计费,请注意,这部分计费不在七牛CDN免费10G流量覆盖范围。</span></p> <p><strong style="background-color: unset; color: unset;">特别注意,在执行命令的时候不一定是qshell.exe,有可能是qshell-windows-x64.exe。</strong></p> </div> </body> </html>

记录一下搭七牛云+picgo+typora

<html> <head></head> <body> <div class="content ql-editor"> <p><br></p> <h1 class="md-end-block md-heading md-focus" style="break-after;break-inside;orphans; font-size: 2.25em;margin-top;margin-bottom;position; line-height: 1.2;border-bottom; color: rgb(51, 51, 51); font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;Segoe UI Emoji&quot;, sans-serif;"><strong>七牛云图床+picgo+typora</strong></h1> <p><br></p> <p>今天心血来潮就想自己弄一个图床,想到就是干,主要还是想在typora中的图片有个地方放</p> <p><br></p> <p><strong>七牛云</strong></p> <p>首先就是去七牛云官网注册账号<a href="https://portal.qiniu.com/home" target="_blank" style="color: rgb(65, 131, 196);">七牛云 - 产品主页 (qiniu.com)</a> 进行认证,这里我是用学校邮箱注册的,所以可以领取一年够用的免费额度。注册以后就是进行认证,微信扫一扫人脸验证一下就过了。</p> <p><strong>图床</strong></p> <p>要想建立图床就得建立一个对象存储空间如图</p> <p><img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/04dqgmvo.jpeg"></p> <p><span style="background-color: rgb(255, 255, 255); font-size: 17px; color: rgb(47, 48, 52);">然后点击创建新的空间具体步骤如下图</span></p> <p><img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/iuxby5yw.jpeg"></p> <p><br></p> <p><span style="background-color: rgb(255, 255, 255); font-size: 17px; color: rgb(47, 48, 52);">然后进入空间管理点入刚刚创建的空间</span></p> <p><span style="background-color: rgb(255, 255, 255); font-size: 17px; color: rgb(47, 48, 52);"><br></span><img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/f6v3sa79.jpeg"></p> <p>设置自己的域名,这里设置完后,七牛云会提示你去自己的域名服务上添加解析记录,如下面第二个图,第一个就是添加一个记录类型为txt并且主机记录为verification并且记录值要从七牛云给的复制。添加就好了,如果要设置CNAME(也就是一个映射吧,我理解)就再设置一个记录类型为CNAME的解析记录。这里有一个坑就是不能设置两个TXT记录类型,不然能够上传图片,但是没有办法访问。</p> <p><img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/9tl9129c.jpeg"></p> <p><img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/s3wdsede.jpeg"></p> <p><br></p> <p><br></p> <p><strong>picgo</strong></p> <p>图床就这样好了,但是要想好好的用就不够,所以下载了picgo <a href="https://picgo.github.io/PicGo-Doc/zh/guide/#%E4%B8%8B%E8%BD%BD%E5%AE%89%E8%A3%85" target="_blank" style="color: rgb(65, 131, 196);">PicGo is Here | PicGo</a> 这是下载地址,傻瓜式安装就好了</p> <p><img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/tc4ogjxs.jpeg"></p> <p>里面的AccessKey和SecrectKey可以去七牛云个人中心获取,bucket就是自己的存储空间的名字,访问网址如果没有https就好加上http:// 网址就是自己设定的网址。存储区域是在自己创建区域时选择的,可以去查对应的编码。最好指定一下路径,好以后管理。</p> <p><br></p> <p><br></p> <p><strong>typora</strong></p> <p>这里就是用picgo插入到软件中,文件---》偏好设置---》图像 插入图片是选择上传图片就可以把图片拖进typora就可以上传到云端了。<img src="https://pic.code-nav.cn/planet_post_image/1645799822881509377/ooigs54d.jpeg"></p> <p><br></p> <p><strong>还有个疑问,就是我用星球的typora激活方法,但是还是会跳出来,试用15天,这是正常的吗</strong></p> </div> </body> </html>

下载 APP