AJAX 图像上传可能的 jquery 带预览
我正在尝试寻找某种带有文件预览功能的 Ajax 上传插件。图像将保存到 MySQL 数据库中。这可能吗?我想只要有一定的要求,一切皆有可能。大家有遇到过这样的事情吗?
I am trying to find some sort of plug-in for Ajax upload with a file preview. The image will be saved into a MySQL dataBase. Is that even possible? I guess all things are possible with certain requirements. Have you guys ever come across anything like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
让我一次一点地解决您的问题:
我正在尝试寻找某种用于 Ajax 上传的插件...
BAM!
...带有文件预览。
<一href="http://webdeveloperplus.com/jquery/ajax-multiple-file-upload-form-using-jquery/">是的,从上面的页面,虽然我可能想知道为什么这是必要的,如果它不会删除它(我相信极简设计通常更好)并使用精美上传 哪个似乎更受欢迎(抱歉,我对ajax上传器没有太多经验)
图像将被保存到MySQL数据库中。这可能吗?
不幸的是,这是可能的;您必须使用 blob 数据类型 (备用教程)。就个人而言,虽然我会创建一个目录并将图像保存在那里,因为这样你就不必每次想要显示图像时都查询MySQL(我会为帽子服务器感到难过)。在这种情况下,我建议您使用 class.upload.php (我对此有很好的经验),与任何 ajax 结合使用您选择使用的上传器。
我想只要有一定的要求,一切皆有可能。你们遇到过这样的事情吗?
...是的
Let me tackle your question one bit at a time:
I am trying to find some sort of plug-in for Ajax upload...
BAM!
...with a file preview.
Yep, from the page above, although I might wonder why this is necessary and if it isn't remove it (I believe minimalist design is usually better) and go with fancy upload which seems to be more popular (sorry, I don't have much experience with ajax uploaders)
The image will be saved into a MySQL dataBase. Is that even possible?
Unfortunately, it is; you will have to use the blob data type (alternate tutorial). Personally though I would just create a directory and save the images there, because then you don't have to query MySQL every f***ing time you want to display the image (I would feel bad for hat server). In which case I suggest you use class.upload.php (I have good experiences with it), in conjunction with whatever ajax uploader you chose to use.
I guess all things are possible with certain requirements. Have you guys ever come across anything like that?
...yes
我还将上传的图像存储在一个目录中,并将它们的名称存储在数据库中。
我开发了一个 jQuery 插件,可以在选择图像时执行动态上传并预览图像。
您可以在此处找到 UploaderPreviewer 插件的演示:
http://dondedeportes.es/uploader-previewer
希望它对您或有相同问题的任何人都有用。
I also store the uploaded images in a directory and their names in the database.
I have developed a jQuery plugin that performs a dynamic upload of an image when it is selected, and previews it.
You can find a demo of the UploaderPreviewer plugin here:
http://dondedeportes.es/uploader-previewer
Hope it is useful for you or for anyone with the same problem.