分页: 1 / 1

curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-04-28 16:31
VolcanoX
各位兄台,我参考下面 github 中的一段代码

https://github.com/wd/emacs.d/blob/mast ... l-paste.el

上传图片到 paste.ubuntu.org.cn

使用 curl 命令上传图片:

代码: 全选

$ curl -F [email protected] -F paste=1 http://paste.ubuntu.org.cn
$ echo $?
0
echo $? 返回 0 是成功的
但是 curl 没有返回上传后的 url 不知道这个是什么问题

谢谢!

Re: curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-04-28 21:12
eexpress
有Paste-img的deb

Re: curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-05-02 9:55
VolcanoX
eexpress 写了:有Paste-img的deb
@ee 我用的 gentoo 不是 debian系,主要是想学习用 curl 提交图片

代码: 全选

$ curl -v -F [email protected] -F paste=1 http://paste.ubuntu.org.cn
* About to connect() to paste.ubuntu.org.cn port 80 (#0)
*   Trying 198.71.86.201...
* Connected to paste.ubuntu.org.cn (198.71.86.201) port 80 (#0)
> POST / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: paste.ubuntu.org.cn
> Accept: */*
> Content-Length: 31419
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------4776cac6af8e
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.1.19
< Date: Thu, 02 May 2013 01:52:20 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.3.10-1ubuntu3.6
< Set-Cookie: PHPSESSID=2kcm7b7abjbqhichv1bc7d5pm6; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Location: /205197
* HTTP error before end of send, stop sending
< 
* Closing connection 0
这个是提交过程的提示信息

Re: curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-05-02 10:22
yjcong
VolcanoX 写了:
eexpress 写了:有Paste-img的deb
@ee 我用的 gentoo 不是 debian系,主要是想学习用 curl 提交图片

代码: 全选

$ curl -v -F [email protected] -F paste=1 http://paste.ubuntu.org.cn
* About to connect() to paste.ubuntu.org.cn port 80 (#0)
*   Trying 198.71.86.201...
* Connected to paste.ubuntu.org.cn (198.71.86.201) port 80 (#0)
> POST / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: paste.ubuntu.org.cn
> Accept: */*
> Content-Length: 31419
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------4776cac6af8e
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.1.19
< Date: Thu, 02 May 2013 01:52:20 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.3.10-1ubuntu3.6
< Set-Cookie: PHPSESSID=2kcm7b7abjbqhichv1bc7d5pm6; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Location: /205197
* HTTP error before end of send, stop sending
< 
* Closing connection 0
这个是提交过程的提示信息
他的意思是那个deb是他写的, 可以看源代码, 里面有如何上传图片

Re: curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-05-06 14:26
VolcanoX
ee 的脚本貌似没有找到 curl 关键词,是用 curl 实现的么?
还是 perl 的内建模块实现的?

Re: curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-05-07 20:42
eexpress
哦。这样。
不是curl实现的,都是perl的模块。几乎万能的WWW::Mechanize

Re: curl 上传图片到 paste.ubuntu.org.cn 无法返回 url

发表于 : 2013-05-07 20:53
eexpress
curl熟悉的,在irc可能有人,你去问问吧。