file_get_contents(): Content-type nicht angegeben, vorausgesetzt, application/x-www-form-urlencoded mit imgur-API

Ich versuche, eine app erstellen, hochladen von Profil-Bildern auf imgur, aber ich habe da ein problem.

if (isset($_POST['uploadprofileimg'])) {
   $image = base64_encode(file_get_contents($_FILES['profileimg']['tmp_name']));

   $options = array('http' => array(
       'method' => "POST",
       'header' => "Authorization: Bearer sdf541gs6df51gsd1bsb16etb16teg1etr1ge61g\n",
       "Content-Type: application/x-www-form-urlencoded",
       'content' => $image
   ));

   $context = stream_context_create($options);

   $imgurURL = "https://api.imgur.com/3/image";

   $response = file_get_contents($imgurURL, FALSE, $context);
}

Ich bin immer dieser Hinweis:

Hinweis: file_get_contents(): Content-type nicht angegeben, vorausgesetzt
application/x-www-form-urlencoded in
C:\WebServer\Apache24\Apache24\htdocs\html\www\SocialNetwork\my-account.php
in Zeile 17

obwohl diese doesn ' T break my app, es ist ärgerlich. Wie kann ich es beheben?

Habe ich versucht, um "User-Agent:MyAgent/1.0\r\n" und "Connection: schließen", um den header-Teil, aber es scheint nicht, um es zu beheben!!!!

InformationsquelleAutor user2985255 | 2017-02-20
Schreibe einen Kommentar