简体   繁体   English

在单独的php线程中将照片上传到Facebook

[英]Uploading photos to facebook in a seperate php thread

I'm building a gallery system, part of which imports and exports images from facebook. 我正在建立一个图库系统,其中一部分从Facebook导入和导出图像。 The problem I'm having is that when you have a lot of source images to copy (~150), the user has to spend a lot of time looking at an inactive screen. 我遇到的问题是,当您要复制大量源图像(约150个)时,用户必须花大量时间查看不活动的屏幕。

Does anyone know if you can send this operation to a background thread using Curl or HttpRequest? 有谁知道您是否可以使用Curl或HttpRequest将此操作发送到后台线程? Is there any special way you would have to handle the facebook auth? 有什么特殊的方法需要处理Facebook身份验证吗?

Ideally, i'd like to post users back to a page saying that the images are on there way, but in the mean time can carry on with what they are doing. 理想情况下,我想将用户发回到页面上,说图像还在路上,但与此同时可以继续他们所做的事情。

Thanks in advance 提前致谢

Write a script that does all the work. 编写完成所有工作的脚本。 You can either executing via a scheduler, or using system/exec calls and run it as a background job. 您可以通过调度程序执行,也可以使用系统/ exec调用将其作为后台作业运行。

exec('php /path/to/my/script.php &');

PHP wont wait for the script to finish. PHP不会等待脚本完成。 But it will continue to run in the background. 但是它将继续在后台运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM