English 中文(简体)
• 如何用Facebook Trends AP[PHP SDK]上载mp3文档
原标题:How to upload mp3 file using Facebook Graph API [PHP SDK]

我正在使用PHP SDK,在面对面的网页上上上上载/公开交响3。 我有言辞的博客,并利用 cr工作来安排职位。 晚期工作没有问题,除了重载这些书状3档案外,一切工作似乎都很出色。

I want to publish these mp3 files with those posts on my facebook page. Currently i am using the following code. Please suggest where am i going wrong while attaching mp3 files. I have already tried removing "media" from attachment parameter.

$args = array(
 access_token  => $post_access_token,
 uid  => $fb_page_id,
 message  => $post->post_title,   
 name  => $post->post_title,
 caption  => get_bloginfo( name ),
 link  => get_permalink($post_id),
 picture  => urldecode(get_post_meta($post_id,  image_value , true)),
 description  => $this->auto_make_excerpt($post->post_content),
 attachment  => json_encode(array(
    "media" =>
    array(
         type  =>  mp3 ,
        "src" => urlencode("http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3"), 
        "title" => "15 Step", 
        "artist" => "Radiohead", 
        "album" => "In Rainbows"
    )
)),
 actions  => json_encode(array(
    array(
         name  =>  Share ,
         link  =>  http://www.facebook.com/sharer.php?u= .urlencode(get_permalink($post_id)). &t= .$post->post_title
    )
))
);$responseId = $this->facebook->api( / .$fb_page_id. /feed ,  POST , $args);
问题回答
"src" => urlencode("http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3"), 

ur已经编码。 你们再一次试图打上code子......你们能否改变这种 子并再次尝试?

在FB中打造以下代码以备案

$attachment = array( type  =>  mp3 ,
        "src" => "http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3", 
        "title" => "15 Step", 
        "artist" => "Radiohead", 
        "album" => "In Rainbows"


 $result = $facebook->api( / . $fb_id .  /feed/ , 
                           post ,
                           $attachment);




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签