duanbeng6709 2012-11-16 10:36
浏览 44
已采纳

在vbulletin中下载未注册用户的附件文件

I have a side script in my forums that allows to my users to upload some stuff from my forums.

I wanted to allow my users to upload attachment file from the forums, but vbulletin always show unregistered form.

So i'm asking is there a way that i can send username and password with attachment link, so vbulletin can identity my user and allow to download that attachment file?

I tried this:

$link = 'http://localhost/vb/attachment.php?attachmentid=2';
$username = 'admin';
$password = '1111';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
echo '<pre>';
print_r($info);
print_r($output);

But as i said, unregistered form show up!

  • 写回答

2条回答 默认 最新

  • doufeng3602 2012-11-21 13:19
    关注

    I found a solution for my problem. since both of my script are in one host, i used copy to copy my attachment file across my host. By this way i don't need to deal with vbulletin.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥15 统计大规模图中的完全子图问题
  • ¥15 使用LM2596制作降压电路,一个能运行,一个不能
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错
  • ¥20 @microsoft/fetch-event-source 流式响应问题
  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式