如何在ASP.NET C中将文件从字符串URL保存到服务器# [英] How to save file from string URL to server in ASP.NET C#

查看:105
本文介绍了如何在ASP.NET C中将文件从字符串URL保存到服务器#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我有一个ASP.NET C#Web应用程序。我有一个使用excel表导入候选人的页面,在这里,我有一个列上传候选图像的列,这是一个字符串URL(图像在客户机上)。



我尝试过:



如何转换ExcelSheet中的字符串URL并将该图像保存到服务器上?



任何人都可以帮助我。



谢谢

Dear All,

I have an ASP.NET C# web application. I have a page to import candidates using excel sheet, in this, I have a column to upload candidate image which is a string URL(image is on the client machine).

What I have tried:

How can I convert the string URL which is in the ExcelSheet and saves that image on to the server?

Can anyone please help me.

Thanks

推荐答案

您不能:您无法直接访问客户端文件系统,除非客户端直接启动传输,否则无法从中获取文件。除非图像嵌入电子表格中,否则无法触摸它。



想一想:如果你能为图像做到这一点,恶意网站可以做到这一点对于你的所有文件,你甚至没有注意到。这是你想要在你的系统中发生的事情吗?
You can't: you have no direct access to the client file system, and cannot fetch files from it unless the client directly initiates the transfer. Unless the image is embedded in the spreadsheet, you can't touch it.

Think about it: if you could do that for an image, malicious sites could do that for all your files without you even noticing. Is that what you want to happen to your system?


这篇关于如何在ASP.NET C中将文件从字符串URL保存到服务器#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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