问题描述
我正在ASP.NET MVC 5中开发Web应用程序,其中一个想要在其上显示图像的Web。该Web表单应该像dropbox一样工作(如果我将图像放入我的PC文件夹,它可能会自动与我的网站合成)。我只是缺乏做这种事情。任何人请提出一个想法。
I'm Developing web application in ASP.NET MVC 5, One of the web from wants to show an images on it. That web form should work as like dropbox (If i put a image into my PC folder, it may automatically synthesize with my website). i'm just getting lack to do this type of thing. Any one please give an ideas.
推荐答案
using (var client = new HttpClient()) {
// get the location of that file
// POST a multipart/form-data content
}
可以在此主题中找到示例: []
最后,您需要处理请求并捕获内容并上传。一个很长的,但是...我相信如果你只是先将算法放在纸上,然后逐步编写源代码,你就可以完成它。
A sample for that can be found in this thread: http://stackoverflow.com/questions/18059588/httpclient-multipart-form-post-in-c-sharp[^]
Then finally, you need to handle the request and capture the content and upload it. A long one, but... I am sure if you simply put the algorithm on paper first and then write the source code step-by-step you will be able to get it done.
这篇关于动态图像从PC上传到网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!