简体   繁体   English

将大型文件(大于10MB)从Android上传到PHP服务器

[英]Uploading large files (greater than 10MB) from Android to PHP server

First of all sorry if this was already asked and sorted out. 首先对不起,如果已经问过并整理出来的话。 I really did a hard search and cant able to find a better solution. 我真的做了很难的搜索,无法找到更好的解决方案。

Requirement: We are developing an Android application where we need to upload the video files to a folder in the web server. 要求:我们正在开发一个Android应用程序,我们需要将视频文件上传到Web服务器中的文件夹。 The web server is running in PHP. Web服务器在PHP中运行。 The video files are very huge in size (more than 10 MB). 视频文件的大小非常庞大(超过10 MB)。 And the web server is hosted on a shared hosting server where they have PHP upload limit as 2MB. 并且Web服务器托管在共享托管服务器上,其中PHP上载限制为2MB。

I hope my requirement is very clear to understand. 我希望我的要求非常清楚。

We struggled for several days and found apache FTP could solve our problem. 我们挣扎了好几天,发现apache FTP可以解决我们的问题。 After having few sleep less nights, we able to done the upload via FTP. 在少睡几个晚上之后,我们可以通过FTP完成上传。 The problem in FTP is if the data (Internet / 3G) goes down then the FTP is stopped and it is not resuming after the data (Internet / 3G) is available. FTP中的问题是,如果数据(Internet / 3G)发生故障,则FTP停止,并且在数据(Internet / 3G)可用后不再恢复。

Now we are back to square 1. Searching again how to upload large files from android device to PHP server. 现在我们回到原点1.再次搜索如何将大型文件从Android设备上传到PHP服务器。

I need your advice on this. 我需要你的建议。 Kindly help. 请帮助。

Thanks & Regards Malai 谢谢和问候Malai

It sounds like you will need to restrict your uploads to only ocurr while the user is on WiFi. 听起来您需要在用户使用WiFi时将上传限制为仅限于ocurr。 You will want to do this anyway since most carriers are now on metered data plans; 无论如何,你会想要这样做,因为大多数运营商现在都在计量数据计划上; if the data connection is lost as in your scenario, then the user will be transmitting way more than just 10MB per upload, as each attempt is transmitting something. 如果数据连接在您的方案中丢失,那么每次上传时用户将传输的方式不仅仅是10MB,因为每次尝试都在传输内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM