[UWP] [JS]使用HTML5在UWP(JS)中上传图像 [英] [UWP][JS]Image Uploading in UWP(JS) with HTML5

查看:57
本文介绍了[UWP] [JS]使用HTML5在UWP(JS)中上传图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我们正在创建一个UWP(JS)项目。


有没有办法上传图片使用Javascript的项目图像目录,上传后返回图像的路径。?使用相同的上传图片显示在页面上。

解决方案


我对这个问题感到困惑。您是否要通过网络将图像从项目上传到服务器? 


如果是这样,您可以使用
Windows.Web.Http
命名空间。此命名空间为UWP应用程序提供了一个现代HTTP客户端API。您可以使用  HttpClient类来发布上传的请求
图片。 


如果图片非常大,我建议您使用  BackgroundUploader Class  是为大文件设计的。


对于图像的路径,你可以要求服务器在您成功上传图片后给予回复。 


祝贺,


Roy


Hello,

we are creating a UWP(JS) Project.

Is there any way to upload an image in the image directory of the project using Javascript and get back the path of the image after uploading.? To use the same uploaded image to appear on the page.

解决方案

Hi,

I'm little confused about the question. Are you going to upload the image from your project to the Server via network? 

If so, you could use the Windows.Web.Http namespace. This namespace provides a modern HTTP client API for UWP app. You could use HttpClient Class for post request that uploads the image. 

If the image is very large, I would suggest that you could use BackgroundUploader Class which is design for large files.

For the path of the image, you could ask the server to give you a response after you upload the image successfully. 

Best regards,

Roy


这篇关于[UWP] [JS]使用HTML5在UWP(JS)中上传图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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