使用 xml 的 post 方法上传图像

发布于 2024-11-15 13:35:37 字数 776 浏览 0 评论 0原文

我对如何使用 xml 解析在 post 方法中粘贴图像感到有点困惑。 我能够发送字符串值,但不知道如何发送图像。 代码片段或任何教程或链接都会非常有帮助。

我的网址是这样的 <一href="http://66.45.25.240/XML/EditProfile.aspx?myguid=45&guid=45&name=aditya&email=xyz@gmail.com&am p;cell=1234567890&title=标题&twitterhandle=tutu.com&facebookhandle=ad@ad.com&picture=a124.jpg" rel="nofollow">http://66.45.25.240/XML/EditProfile.aspx?myguid=45&guid=45&name=aditya&[电子邮件受保护]&cell=1234567890&title=Title&twitterhandle=tutu.com&[email protected]&picture=a124.jpg

这里我不知道如何传递图片部分。 问候 姆鲁根

I am bit stuck about how to pase the image in post method with xml parsing .
I am able to send the string values but dont know how to send the images .
A code snippet will be very helpful or any tutorial or link.

My url is something like this
http://66.45.25.240/XML/EditProfile.aspx?myguid=45&guid=45&name=aditya&[email protected]&cell=1234567890&title=Title&twitterhandle=tutu.com&[email protected]&picture=a124.jpg

Here i dont know how to pass the picture part .
Regards
Mrugen

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凝望流年 2024-11-22 13:35:37

您不应该使用 HTTP GET,因为参数的可能长度非常有限。

请改用 POST。这是链接 举个例子

You shouldn't use HTTP GET because the possible length of the parameters is very limited.

Use POST instead. Here's a link to an example

半岛未凉 2024-11-22 13:35:37
    <?php
 $i= 0; // counter
$url = "http://post.jagran.com/rss/post/category/Bollywood.xml"; // url to parse
$rss = simplexml_load_file($url); // XML parser

// RSS items loop

print '<h2><img style="vertical-align: middle;" src="'.$rss->channel->image->url.'" /> '.$rss->channel->title.'</h2>'; // channel title + img with src

foreach($rss->channel->item as $item) {
if ($i < 10) { // parse only 10 items
    print '<a href="'.$item->link.'">'.$item->title.'</a><br />';
    print '<a href="'.$item['image']->link.'">'.$item['image']->url.'</a><br />';

}

$i++;
} 
    <?php
 $i= 0; // counter
$url = "http://post.jagran.com/rss/post/category/Bollywood.xml"; // url to parse
$rss = simplexml_load_file($url); // XML parser

// RSS items loop

print '<h2><img style="vertical-align: middle;" src="'.$rss->channel->image->url.'" /> '.$rss->channel->title.'</h2>'; // channel title + img with src

foreach($rss->channel->item as $item) {
if ($i < 10) { // parse only 10 items
    print '<a href="'.$item->link.'">'.$item->title.'</a><br />';
    print '<a href="'.$item['image']->link.'">'.$item['image']->url.'</a><br />';

}

$i++;
} 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文