使用Ajax上传图片? [英] Upload images with Ajax?

查看:114
本文介绍了使用Ajax上传图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这时候,我的问题是:我要上传使用文件输入图像和,而不是刷新整个我的网站,我希望有一个简单的AJAX装载机翻来翻去,几秒钟后得到一个上传的图片作为结果在同一个页面。我想,谷歌找到了我几个剧本,但我似乎并没有让他们的工作。

This time my question is the following: I want to upload images using a file input and instead of refreshing the whole I site, I want a simple AJAX loader to roll and after a few seconds get an uploaded image as a result IN THE SAME PAGE. I tried a few scripts that google found for me, but I didn't seem to get them working.

任何人都能够帮助知识或有用的东西网上有?

Anyone able to help with knowledge or something useful online?

感谢。

推荐答案

您可以轻松地使用ajaxupload将图像发送到服务器端,然后获取图像上的成功返回的功能。

You can easily use ajaxupload to send images to the server side and then get the image on the success return of the function.

 $("#form1").ajaxForm({
          target: '#preview',
          beforeSubmit: function(){
             $('.upload').after('<span class="loading-bar">Processing...</span>');
            },
          success: function (){
            $('.loading-bar').hide('slow');
            setCrop();
            },
            url: "/account/processpicture"
          }).submit();

这篇关于使用Ajax上传图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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