上传大视频文件

发布于 2025-01-11 22:48:11 字数 210 浏览 0 评论 0原文

我想建立一个网页(简单形式),用户可以在其中提交媒体文件,很可能是视频文件。 视频文件大小为 100mb - 500mb(或可能更大,具体取决于文件压缩) 我想知道您是否可以推荐任何适合我的要求的托管计划(或公司)。

我想我会编写 php 脚本来上传文件,但我不确定 PHP 是否是正确的。如果您碰巧知道您可以建议的任何上传选项(甚至是第 3 方上传者),我们将非常感激。

谢谢

I would like to build a webpage(simple form) where users can submit media files, most likely video files.
The video files will be anywhere from 100mb - 500mb(or possibly more, depending on the file compression)
I was wondering if you could recommend any hosting plan(or company) that may fit my requirement.

I was thinking that I will be writing php script to upload the file but I'm not sure if PHP would be the right one. If you could also happen to know any uploading options you could suggest(even 3rd party uploader), that will be very appreciated.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁与争疯 2025-01-18 22:48:11

你可以简单地使用php,它能够处理文件上传。无需花钱找第三方。对于字体端,您可以使用 javascript Form Api 或任何文件上传库。

另一件需要注意的事情是在上传之前正确验证文件。一个方便的库是 Helga(我维护它)。可以在这里找到 https://github.com/phrenotype/helga

验证文件是否干净的代码就像

use Chase\Helga\validate;

$path = '/files/pdf.pdf';
$v = validate($path)->withRules(['file']);

if($v->passed()){
    // Do something ?
}else if($v->failed()){
    //Errors ?
    var_dump($v->flatErrors());
}

底线一样简单,您不需要第三方平台。 PHP 能够处理它。但是,您现在要对您的文件负责。

You can simply use php, it's capable of handling file uploads. No need to spend money on a third party. For the font-end, you can use the javascript Form Api or any file upload library.

Another thing to take note is to properly validate the files before uploading. A handy library for doing is is Helga ( I maintain it ). It can be found here https://github.com/phrenotype/helga.

Code for validating if a file is clean is as simple as

use Chase\Helga\validate;

$path = '/files/pdf.pdf';
$v = validate($path)->withRules(['file']);

if($v->passed()){
    // Do something ?
}else if($v->failed()){
    //Errors ?
    var_dump($v->flatErrors());
}

Bottom line is, you don't need a third party platform. PHP is capable of handling it. However, you're now responsible for your files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文