按钮点击上传文件,无需fileuploader [英] Upload file on button click without fileuploader
问题描述
我想在点击按钮上传文件,之后我希望用户重定向另一个页面。
这可以通过fileuploader的帮助轻松完成并使用另一个按钮上传文件,但我想要在单个按钮上执行所有这些过程。我用谷歌搜索并发现服务器文章,建议我使用 AJAX 和 JQuery。我试过Jquery但对我来说似乎很难自定义这篇文章。有没有其他方法上传文件,然后重定向到其他页面?在此先感谢:)
I want to upload a file on button click and after that i want user to redirect another page.
This can easily done with the help of fileuploader and using another button to upload file, but i want to perform all this process on single button. I googled and found server article which suggest to me to use AJAX and JQuery. I tried with Jquery but it seems difficult for me to customize this article's. Is there any other way to upload file and later redirect to other page? Thanks in advance :)
推荐答案
在纯Javascript中上传文件在你提到的方法中是不可能的 - 你必须与某种类型的服务器通信。
您可以尝试使用此处建议的以下方法或考虑寻找使用HTML5文件API,这将允许这种功能。
Uploading a file in pure Javascript in the method that you are mentioning is not possible - you have to communicate with a server of some sorts.
You could try using the following method suggested here or consider looking into using the HTML5 File API, which would allow this kind of functionality.
参考: - 确切解决你的问题正在寻找::)
使用JavaScript和HTML 5创建文件上传器[ ^ ]
问候,
Praveen Nelge
Reference :- exact solution what you are looking for : :)
Creating a File Uploader Using JavaScript and HTML 5[^]
Regards,
Praveen Nelge
这篇关于按钮点击上传文件,无需fileuploader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!