We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用sdk的简单上传
···php composer show aliyuncs/oss-sdk-php
name : aliyuncs/oss-sdk-php descrip. : Aliyun OSS SDK for PHP keywords : versions : * v2.4.3 php >=5.3
requires (dev) phpunit/phpunit * satooshi/php-coveralls * ··· 第一行fopen 保证文件能够获取到是个资源
在Ossclient.php的uploadFile打印$option 得到array结果,可以看到uploadFile参数是临时缓存目录资源,object为txt后缀的oss目录
Ossclient.php
uploadFile
$option
array
object
同时在func generateHeaders 如果不拼接content-type 则会报MissingContentLength 错误
generateHeaders
content-type
MissingContentLength
所以在其中添加
if (isset($options[self::OSS_CONTENT_LENGTH])) { $headers[self::OSS_CONTENT_LENGTH] = $options[self::OSS_CONTENT_LENGTH]; }
此后可以上传成功,但是上传结果为空白,不仅仅是png,xlsx,doc等都为空白文件(上传之前确定文件可以打开,且有数据)
The text was updated successfully, but these errors were encountered:
我也遇到了一样的问题
Sorry, something went wrong.
No branches or pull requests
使用sdk的简单上传
···php
composer show aliyuncs/oss-sdk-php
name : aliyuncs/oss-sdk-php
descrip. : Aliyun OSS SDK for PHP
keywords :
versions : * v2.4.3
php >=5.3
requires (dev)
phpunit/phpunit *
satooshi/php-coveralls *
···
第一行fopen 保证文件能够获取到是个资源
在
Ossclient.php
的uploadFile
打印$option
得到array
结果,可以看到uploadFile
参数是临时缓存目录资源,object
为txt后缀的oss目录同时在func
generateHeaders
如果不拼接content-type
则会报MissingContentLength
错误所以在其中添加
此后可以上传成功,但是上传结果为空白,不仅仅是png,xlsx,doc等都为空白文件(上传之前确定文件可以打开,且有数据)
The text was updated successfully, but these errors were encountered: