我正在尝试通过我用PHP构建的API将图像上传到我的blob存储。
目前我有这个,base64字符串是通过JSON Post发送的。
//基数为64的字符串$ displayPictureBase64 = $ this-& …
我通过以下方式修复它...
//The base 64 string $displayPictureBase64 = $this->ValidateParameter('DisplayPicture', $this->param, STRING); //Convert the file to stream $fileToUpload = fopen('data:image/jpeg;base64,' . $displayPictureBase64,'r'); //Name of the blob $blobName = "MyBlobName"; //New BlobStorage class. $blob = new BlobStorage; $blob->AddBlob('user-display-pictures', $blobName, $fileToUpload);