上传大文件到Amazon S3直接使用Web表单和PHP添加其他日期到数据库 [英] Upload large files to Amazon S3 directly and add other date to database using web forms and PHP

查看:374
本文介绍了上传大文件到Amazon S3直接使用Web表单和PHP添加其他日期到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Web表单,其中用户提供了大量的文件,如标题和描述的一些信息。当提交表单时,应将文件直接上传到Amazon S3(没有上传到网络服务器),而信息是使用PHP添加到数据库中。

I want to create a single web form where a user provides a large file, and some information like title and description. When the form is submitted, the file should be directly uploaded to Amazon S3 (without uploading it to the web server), while the information is added to the database using PHP.

我怎么会去这样做呢?我知道我可以使用href="http://doc.s3.amazonaws.com/proposals/post.html" rel="nofollow">直接上传后的解决方案的

How would I go about doing this? I know I could use the direct upload post solution, but then I wouldn't be able to add the other information to the database.

推荐答案

我想实现一个AJAX S3的文件提交(使用直接上传的参数,最终),然后提交所有其他字段到Web服务器在第二步骤(即使不是阿贾克斯,当然)。

I would implement an ajax submit of the file on S3 (using the direct upload parameters, eventually) and then submit all the other fields to your webserver in a second step (even not ajax, of course).

您也可以使用隐藏域在表单提交新S3的链接(你可以检索AJAX上传完成后),因为我猜你需要储存在一起。它与所有其他数据。

You could also use an hidden field in your form to submit the new S3 link (which you can retrieve after the ajax upload is completed), since I guess you need to store it together with all the other data.

这篇关于上传大文件到Amazon S3直接使用Web表单和PHP添加其他日期到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆