我有一个要求用户名、密码和图像文件的 html 。
然后我使用此脚本将其上传到 snapchat 故事:
<?php
$target_dir = "uploads/";
$target_dir = $target_dir . basename( $_FILES["uploadFile"]["name"]);
$uploadOk=1;
if (move_uploaded_file($_FILES["uploadFile"]["tmp_name"], $target_dir)) {
echo "The file ". basename( $_FILES["uploadFile"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
$user = $_POST['user'];
$pass = $_POST['pass'];
$img = $_FILES["uploadFile"]["tmp_name"];
require_once("src/snapchat.php");
$snapchat = new Snapchat($user, $pass);
$id = $snapchat->upload(Snapchat::MEDIA_IMAGE,file_get_contents($img));
$snapchat->setStory($id, Snapchat::MEDIA_IMAGE, 10);
?>
但它不起作用!它一直在说:
Warning: file_get_contents(/tmp/phpCO1pki) [function.file-get-contents]: failed to open stream: No such file or directory in /home/u753295385/public_html/run_command.php on line 18
我可能忘记了什么。如果你能帮助我,那就太棒了!