Php 视频上传错误instagram api mgp25
我正在使用instagram api上传图像和视频,图像正在发布,工作正常,但问题在于视频上传。扔掉这个例外。 在控制器中,图像post正在工作,但视频post不工作 错误是。 JsonMapper::map()要求第一个参数是对象,给定NULL 我的ajax上传方法是Php 视频上传错误instagram api mgp25,php,laravel-5.2,instagram-api,Php,Laravel 5.2,Instagram Api,我正在使用instagram api上传图像和视频,图像正在发布,工作正常,但问题在于视频上传。扔掉这个例外。 在控制器中,图像post正在工作,但视频post不工作 错误是。 JsonMapper::map()要求第一个参数是对象,给定NULL 我的ajax上传方法是 if($('#iCheck').is(':checked')){ $.ajax({ type:'POST', url:'instagram/write',
if($('#iCheck').is(':checked')){
$.ajax({
type:'POST',
url:'instagram/write',
data:{
'caption':status,
'image':image,
'video':video
},
success:function (data) {
count = count - 1;
if (count == 0) {
loading.hide(100);
}
if (data == 'success') {
$('#iMsgSu').show(300);
}
else {
$('#iMsgEr').html(data);
$('#iMsgEr').show(300);
}
console.log(data);
count = count - 1;
if (count == 0) {
loading.hide(100);
var sentData = fbId + '_' + twId + '_' + tuId + '_' + wpId;
postSave(sentData);
$('#final').val(sentData);
}
}
});
}
public function write(Request $request)
{
try {
$image = $request->image;
$video = $request->video;
if ( $image ) {
$this->instagram->uploadPhoto(public_path() . "/uploads/" . $request->image, $request->caption);
}
if ( $video ) {
$this->instagram->uploadVideo(public_path() . "/uploads/videos/" . $request->video, $request->caption);
}
return "success";
} catch (\Exception $exception) {
return $exception->getMessage();
}
}
我的控制器方法是
if($('#iCheck').is(':checked')){
$.ajax({
type:'POST',
url:'instagram/write',
data:{
'caption':status,
'image':image,
'video':video
},
success:function (data) {
count = count - 1;
if (count == 0) {
loading.hide(100);
}
if (data == 'success') {
$('#iMsgSu').show(300);
}
else {
$('#iMsgEr').html(data);
$('#iMsgEr').show(300);
}
console.log(data);
count = count - 1;
if (count == 0) {
loading.hide(100);
var sentData = fbId + '_' + twId + '_' + tuId + '_' + wpId;
postSave(sentData);
$('#final').val(sentData);
}
}
});
}
public function write(Request $request)
{
try {
$image = $request->image;
$video = $request->video;
if ( $image ) {
$this->instagram->uploadPhoto(public_path() . "/uploads/" . $request->image, $request->caption);
}
if ( $video ) {
$this->instagram->uploadVideo(public_path() . "/uploads/videos/" . $request->video, $request->caption);
}
return "success";
} catch (\Exception $exception) {
return $exception->getMessage();
}
}
您必须实现
ffprobebin
和ffmpeg
才能通过mgp25
instagram API上传视频
\InstagramAPI\Utils::$ffprobeBin = 'Directory\Instagram-Project\FFmpeg\ffprobe.exe';
\InstagramAPI\Utils::$ffmpegBin = 'Directory\Instagram-Project\FFmpeg\ffmpeg.exe';
如果您想要php示例,我可以发送。您的服务器的上载限制是多少?检查您的apache/nginx配置,以及您的php.ini-值是多少?服务器上载限制为30 MB,而我尝试上载的文件大小为5 MB。请发送给我好吗?jabbasov020@gmail.com