有什么方法可以在一个请求中允许多个文件上传到Google?本指南让我相信你可以,但我复制了那个演示,它似乎不适合我。
app.yaml
application: splink-api
runtime: php55
api_version: 1
default_expiration: "1h"
handlers:
- url: /handle_upload
script: handle_upload.php
- url: /direct_upload
script:direct_upload.phpdirect_upload.php
<?php
// Direct uploads requires PHP 5.5 on App Engine.
if (strncmp("5.5", phpversion(), strlen("5.5")) != 0) {
die("Direct uploads require the PHP 5.5 runtime. Your runtime: " . phpversion());
}
?>
<html>
<body>
<form action="handle_upload" method="post" enctype="multipart/form-data">
Send these files:<p/>
<input name="userfile[]" type="file" multiple="multiple"/><p/>
<input type="submit" value="Send files" />
</form>
</body>
</html>handle_upload.php
<?php
header('Content-Type: text/plain');
print_r($_FILES);在以下方面的成果:
Array
(
[userfile] => Array
(
[name] => Array
(
[0] => arryn.jpg
)
[type] => Array
(
[0] => image/jpeg
)
[tmp_name] => Array
(
[0] => vfs://root/uploads/0
)
[error] => Array
(
[0] => 0
)
[size] => Array
(
[0] => 721332
)
)
)使用具有相同代码的简单php服务器将产生以下结果:
Array
(
[userfile] => Array
(
[name] => Array
(
[0] => arryn.jpg
[1] => baratheon.jpg
)
[type] => Array
(
[0] => image/jpeg
[1] => image/jpeg
)
[tmp_name] => Array
(
[0] => /private/var/folders/rc/z5ky3d3s29v0bsdllnzvpj8r0000gn/T/phpUt5H8S
[1] => /private/var/folders/rc/z5ky3d3s29v0bsdllnzvpj8r0000gn/T/phpijjaNO
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 721332
[1] => 234717
)
)
)在日志中看不到任何错误,我尝试过处理非常小的文件,所以这不应该是一个问题。在开发服务器上进行本地测试。有什么想法吗?
发布于 2016-04-10 20:41:13
在php.ini中,我需要改变
max_file_uploads: 1至
max_file_uploads: 100这在我看过的任何演示或文档中都没有很好的文档。
https://stackoverflow.com/questions/36487786
复制相似问题