如何扩展 plupload 来询问用户文件的标题?
我使用 plupload 允许用户将照片上传到我的网站,效果很好。
我也一直在使用 jQuery 队列小部件。
现在,有什么方法可以要求用户为他们上传的每张照片指定一个(可选)标题?目前我的服务器方法只接受文件名、块和内容本身。我只是想要另一个参数“照片标题”。
当然,我可以撕掉队列小部件并在每张照片旁边编写一个带有文本框的自定义小部件,但希望有一种更简单的方法,或者一个可以实现此目的的预构建插件/小部件。
有什么想法/建议吗?
I'm using plupload to allow users to upload photos to my website, which works great.
I've been using the jQuery queue widget as well.
Now, is there any way i can ask the user to specify an (optional) title for each photo they upload? Currently my server method accepts just the filename, the chunk, and the content itself. I simply want another parameter for "photo title".
Of course, i can rip out the queue widget and write a custom widget with textboxes next to each photo, but was hoping there is an easier way, or a pre-built plugin/widget that enables this.
Any ideas/recommendations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以分两步进行,完成上传后要求用户输入新上传文件的标题,或者您应该实现自己的小部件并向 plupload 的各种事件添加侦听器以与输入一起渲染队列允许用户输入标题的元素。
开箱即用的 jquery 小部件不可能通过简单的配置来实现。您始终必须扩展或实现自定义上传脚本。
查看自定义上传示例,您将了解如何呈现元素plupload 事件并提交值。
You can either do it in a 2 step process, after finishing the upload ask the user to enter the titles for the newly uploaded files or you should implement your own widget and add listeners to the various events of plupload to render the queue along with input elements to allow the user to enter titles.
Out of the box with the jquery widget it's not possible through simple configuration. You'll allways have to extend or implement a custom upload script.
Take a look at the Custom upload example, you'll get an idea of how to render the elements on the plupload events and submit the values along.