HTML page code
PHP code
print_r($_FILES);//Android时,这里输出为空,但是上传文件的临时文件夹是看到有文件生成的。//ios时,这里输出的是正常的(与pc时一致,error代码也是0),但是在服务端视频文件的大小为0k,并且服务端打开视频说这是一个空白/缺损视频$file=$_FILES['testFile'];move_uploaded_file($file["tmp_name"],"upload/" .$file["name"]);echo "保存成功: " . "upload/" . $file["name"];
Is there a way to solve this problem? This is only used on mobile phones, so you can use a variety of technologies such as HTML5 and other mobile web support
Reply content:
HTML page code
PHP code
print_r($_FILES);//Android时,这里输出为空,但是上传文件的临时文件夹是看到有文件生成的。//ios时,这里输出的是正常的(与pc时一致,error代码也是0),但是在服务端视频文件的大小为0k,并且服务端打开视频说这是一个空白/缺损视频$file=$_FILES['testFile'];move_uploaded_file($file["tmp_name"],"upload/" .$file["name"]);echo "保存成功: " . "upload/" . $file["name"];
Is there a way to solve this problem? This is only used on mobile phones, so you can use a variety of technologies such as HTML5 and other mobile web support
Up to now, iOS video upload is done, but only one video at a time (perhaps you can do more than one fileinput to allow users to choose several times to upload multiple videos, but which demand is so perverted!) )
First of all
Need to be multiple="multiple"
removed, because iOS select a single file, if this is a video file, will automatically compress the video (compression process is in the video selection interface, do not need us to do anything), but if it is a multi-select file, it will not be automatically compressed, resulting upload to the service side of the video is always 0k, and no error.
And then
If the server is PHP, then you need to follow the http://www.admin10000.com/Document/69.html configuration php.ini
file, as to php.ini
where to find the file, if you are Wamp, Then in the Wamp folder there search php.ini, the result will be two, it should be Apache below, if changed not yet, on the other one also changed.
Problems that still exist
Android is still the same problem, no error, there is upload action (in the upload folder can see the temporary file generation) But after this action is finished not to see the upload file, and Print_r ($_files), the result is an Array()
empty array ...
But see iOS compressed video after uploading success, perhaps the breakthrough is compressed video, I now look for JS compressed video method
February 4, 2015 10:49:28 update
Found millet 1s (the year before the student dog, poor, bought, and now put in the company when the test machine) incredibly can successfully upload!!! I'll try another android.
Kiss, I'm wrong, the problem is solved.
The original problem is php.ini
the setting! I have a test machine with the video is 83M, but php.ini
set the maximum upload file is 80M, so it will fail! Now iOS and Android on my hands are all successful, and it's not recommended that you choose the multiple-file input file!
Using the browser to perform the upload file may have a puzzling problem, this problem I have encountered before the development of third-party applications. In the final analysis, there are special treatments and limitations.
It is recommended that you use the mobile system browser to test, if normal, your code is OK, it is recommended that the system browser performance prevail.
PS: Has launched the JS-SDK, including file upload, it is recommended that you have the necessary circumstances to see the open JS-SDK, to assist the Web development and JS-SDK sample page.