Facebook 下载照片和 ServerXMLHTTP
您好,提前致谢。在在这里发帖之前,我在网上和这里也进行了很多搜索。
我有一个网站,允许用户加入他们的 Facebook 个人资料,这样在他们的许可(FB 应用程序)下,网络将下载他们的主要照片。
我使用这个脚本服务器端和经典 ASP(并且我必须使用 ASP)来下载主照片,并且在随机情况下会出现错误: msxml3.dll 参数不正确。
''DownloadURL is the url pf the photo
''example "http://profile.ak.fbcdn.net/xxxxxxxxxxxxxx.....xxxxxx.jpg"
Dim objXML
Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
objXML.Open "GET", DownloadURL , true ' <-- this line get the error sometimes
objXML.Send
'.... code to handle the request
' and save photo using ADODB.Stream
但是如果我尝试我的工作站相同的照片网址重现错误,该死的工作正常,所以我无法检查问题是什么。
我使用 Windows 2008 服务器 SE SP2 和 IIS7
我的问题是:
- MSXML2.ServerXMLHTTP 是否已过时?
- 我还需要知道什么?
- 这与客户端浏览器(例如 IE)有关吗?
- 我可以从这里的专家那里得到什么建议或提示吗?
预先感谢您的帮助
Hello and thanks in advance. Before to post here i search a lot in the net and here as well.
I have a site that let the user join with their facebook profile so with their permission (FB application) the web will download their main photo.
I used this script server side with classic ASP (and i must use ASP) to download the main photo and in random cases it through an error: msxml3.dll The parameter is incorrect.
''DownloadURL is the url pf the photo
''example "http://profile.ak.fbcdn.net/xxxxxxxxxxxxxx.....xxxxxx.jpg"
Dim objXML
Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
objXML.Open "GET", DownloadURL , true ' <-- this line get the error sometimes
objXML.Send
'.... code to handle the request
' and save photo using ADODB.Stream
But if i try on my workstation the same photo url to reproduce the error, damn this work fine so i cant check what is the problem.
I use Windows 2008 server SE SP2 and IIS7
my questions are:
- Is MSXML2.ServerXMLHTTP obsolete ?
- what more do i need to know ?
- is this related to the client browser (example IE) ?
- Any suggestions or tips that i can receive from the gurus here ?
Thanks in advance for this help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议的第一件事可能会导致您出现很多问题,那就是不要使用 profile.ak.fbcdn.net url。该 url 不一定是恒定的。我建议使用支持的网址 http://graph.facebook.com/facebookid/photo其中 facebookid 是您正在下载照片的用户的 ID。
关于 MSXML2.ServerXMLHTTP 的使用,我已经很久没有使用过那个东西了,但似乎该对象可能不是下载图像文件的最佳选择。查看可能相关的讨论:http://www.daniweb.com/forums/thread153966。 html
The first thing I would suggest that is likely causing a lot of your problems is to not use the profile.ak.fbcdn.net url. That url is not necessarily constant. I would suggest using the supported url of http://graph.facebook.com/facebookid/photo where facebookid is the id of the user who's photo you are downloading.
Regarding the use of MSXML2.ServerXMLHTTP I haven't used that stuff in ages, but it seems like that object probably isn't the best for downloading an image file. Check out this discussion that may be relevant: http://www.daniweb.com/forums/thread153966.html