0
我正在實施Facebook批處理過程以使用單個請求上傳多個圖像。 我使用在給出的簡單的例子:Facebook批處理錯誤
而且我的代碼如下:
$str = "curl
–F ‘access_token=…’ \
-F ‘batch=[{
「method」:」POST」, \
「relative_url」:」ALBUM_ID/photos」, \
「body」:」message=My photo」 \
"attached_files":"file1" \
},
{
「method」:」POST」, \
「relative_url」:」ALBUM_ID/photos」, \
「body」:」message=My photo」 \
"attached_files":"file2" \
},
{
「method」:」POST」, \
「relative_url」:」ALBUM_ID/photos」, \
「body」:」message=My photo」 \
"attached_files":"file3" \
},
]’
-F ‘[email protected]’ \
-F '[email protected]' \
-F '[email protected]' \
https://graph.facebook.com "
exec($str, $error);
當我檢查我的$error
變量它表明我"curl: -F not found"
。
如果我在瀏覽器上回顯該字符串,然後在終端上覆制/過去確實對我有用。
我不明白爲什麼這不適用於PHP。
謝謝!
嘗試從各行的結尾處,刪除 「\」。 – Smit 2012-03-15 16:54:26
不,不工作..給我錯誤,如「-F主機未找到」:( – Smit 2012-03-15 16:55:49