通过csv上传图像文件,引用ASP.NET项目中的路径 [英] Upload image file through csv refering the path in ASP.NET project

查看:71
本文介绍了通过csv上传图像文件,引用ASP.NET项目中的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用asp.net webform和sql server开发一个项目。现在我的客户端想要上传csv文件。这些列就像lotNumber,Description和其他。有很多imagaes各自有lotNumbers。如果文件上传到服务器然后可能没有问题,但现在问题是他们不知道如何通过浏览器上传文件,以便他们将图像放在相同的目录与相应的lotNumber但不会在csv文件列。我的作用是从csv coloum获取批号并获取存储在客户端浏览器目录中的图像,并将文件上传到服务器并将它们保存到数据库。我知道大多数浏览器都无法访问到客户端本地机器的一些安全问题。任何人都可以帮我完成工作吗?



我尝试过的事情:



我也试过Jquery但是没有用。我需要一些想法,因为我要不惜一切代价完成工作

I'm developing a project in asp.net webform and sql server .Now my client wants to upload csv file .The columns are like lotNumber ,Description, and others.There are some lot imagaes with respective lotNumbers.If the files are uploaded to the server then there might have no issue but now the issue is they don't know how to upload files through browsers so that they will put the images in the same directory with respective lotNumber but that won't be specified in the csv file columns.My role is to fetch the Lot number from the csv coloum and fetch the image stored in the client browser directory and upload the files to the server and save them to the database .I know that most of the browsers cant have access to the client local machine for some security issues. Can any one help me to get the work done ?

What I have tried:

I've tried by Jquery also but didn't work.I need some ideas cause I've to get the job done at any cost

推荐答案

引用:

任何人都可以帮我完成工作吗?

Can any one help me to get the work done ?



不,你甚至知道原因。


No, and you even know why.

引用:

我知道大多数浏览器都无法访问客户端本地机器一些安全问题。

I know that most of the browsers cant have access to the client local machine for some security issues.



你是对的,这是一个安全功能。



但是如果你可以手动让用户上传文件,有可能。

HTML DOM输入文件上传对象 [ ^ ]

jQuery文件上传演示 [ ^ ]


你不能。



没有浏览器可以自动访问客户端的文件系统,因为这将是一个主要的安全漏洞。您可以访问客户端上文件的唯一方法是显示打开文件对话框并让用户选择文件。
You can't.

No browser has automated access to the client's file system, because that would be a major security vulnerability. The only way you can access files on the client is by showing the "Open File" dialog and having the user select the files.


这篇关于通过csv上传图像文件,引用ASP.NET项目中的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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