显示一个上传表单。
我们已经确立了一个策略,现在让我们设置上传表单。
Now that we've established a policy, let's set up the upload form.
当Ajax回调调用时,我们将提交第二个上传表单。
When the Ajax callback is invoked, we'll submit the second upload form.
图4显示的是针对Bigtable实现的上传表单。
左面板中的Forms链接(如图6所示)使管理员能够上传表单模版。
The forms link in the left panel, shown in figure 6, enables the administrator to upload the forms template.
在我们上传数据到Bigtable之前,我们需要创建一个上传表单。
Before we can upload data to Bigtable, we'll need to create an upload form.
通过本文您了解了如何设置HTML上传表单将文件直接上传到S3。
You've now seen how to set up an HTML upload form to upload files directly to S3.
第2部分展示了s3上传表单;下一次我们将把此表单连接到本文编写的代码中。
Part 2 showed you the S3 upload form; and next time we'll connect that form to the code written here.
然后代码会转发到清单13所创建的表单中,而上传表单就是在这个表单中使用的。
The code then forwards to the form created in Listing 13, where the upload URL is expected.
最后,新的Photoid会返回给回调函数,并在上传表单提交之前被附加到success_action_redirect的URL上。
Finally, the new Photo ID is returned to the callback and appended to the URL in success_action_redirect before the upload form is submitted.
我们不需要重复地为Blobstore 创建上传表单:我们只需要将datastore.jsp 复制为一个名为Blobstore.jsp文件,然后增加清单13 所示的粗体代码
There's not much to repurposing our upload form for Blobstore: just copy datastore.jsp to a file named blobstore.jsp, then augment it with the bold lines of code shown in Listing 13
这样便支持从HTML表单上传文件。
本文将展示直接从一个HTML表单上传文件,从而最小化服务器的负载。
This article shows you upload a file directly from a HTML form, thus minimizing the load on your server.
一旦用户选择了要上传的文件,将标题和可选标记输入此表单并提交后,脚本的另一半就会发挥作用。
Once the user selects an image file for upload, enters a title and optional tags into this form and submits it, the second half of the script swings into action.
要开始实现,您需要一个带有表单的页面来进行文件上传。
To start the implementation, you need a page with a form on it that will allow for file uploads.
也可以模拟文件的上传和表单的定期提交。
Simulation of file upload action as well as regular form submission is also possible.
但是HttpPostedFile类的描述声明“默认情况下,所有的请求,包括表单域和上传的文件大于256KB的都缓冲到磁盘,而不是在服务器内存中。”
But the HttpPostedFile class description states that "By default, all requests, including form fields and uploaded files, larger than 256 KB are buffered to disk, rather than held in server memory."
这些技术覆盖较大的范围,从简单的分页和数据库记录排序,再到复杂的通过Web表单支持文件上传和编写定制输入验证器。
These range from the pedestrian, such as paging and sorting database records, to the more complex, such as supporting file uploads through Web forms and writing custom input validators.
最后,查看请求是一个表单post还是文件上传,在这种情况下,输出数据作为一个有效的html页面,该页面的元素中含有json格式编码的输出。
Finally, check to see if the request made was a form post or a file upload, in which case you output the data as a valid HTML page with the JSON-encoded output contained in a HTML element.
通过HTML表单上传
一个显示我们刚刚创建的表单,另一个处理表单的上传。
One displays the form we just created and another processes its uploads.
这个表单内嵌的编辑器可以支持附件,并可以作为资源上传图像,然后在编辑器中进行显示。
The form's built-in editor supports attachments and uploading an image as a resource, then displaying it in the editor.
将表单上传到请求数据的服务器可以解决部分问题。
Now, you can solve part of the problem by uploading the form to the server from which you'll be requesting the data.
我们从最简单的东西入手:一个包含多个字段的注册表单,希望通过Ajax而不是常规的Web表单上传办法来提交。
Start with something really simple: a multi-field registration form that you want to submit with Ajax instead of using the regular Web form Posting path.
表单数据被编码成多部分MIME消息。如果把文件上传到服务器,使用的是这种格式。
Form data is encoded as a multipart MIME message. Use this format if you are uploading a file to the server.
针对实际应用的问题,提出一种基于数据库的文件上传方法,该方法通过表单提交文件信息,服务器端程序从多域数据流析取文件内容并直接写入数据库。
By sending the file information through HTML form, the Action on the server side extract the file from multipart stream and store it into the database.
在上传页中增加新的表单,以允许使用者一次多档上传。
Adds a new forms to Posting page that allow user to upload multiple files at once.
在上传页中增加新的表单,以允许使用者一次多档上传。
Adds a new forms to Posting page that allow user to upload multiple files at once.
应用推荐