输入类型文件在服务器上不起作用 [英] Input type file not working on server

查看:91
本文介绍了输入类型文件在服务器上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All。



当我使用输入类型文件然后在本地主机上浏览它工作正常

输入文件语法是


< input type =filename =fileDetailsid =fileDetails/>



但是当我在服务器上部署项目时,它总是占用另一条路径并抛出异常。在服务器上,它在iis文件夹中找到文件,而不是采取浏览路径



所以有人可以为我提供适当的解决方案吗?



在此先感谢..................

Hello All.

When i use the input type file and then browse on local host it work fine
the input file syntax is

<input type="file" name="fileDetails" id="fileDetails" />

but when i deploy the project on server then it always take the another path and throw an exception. on server it finds the file in iis folder and not take the browse path

So can anyone please provide me the appropriate solution for the problem?

Thanks In Advance..................

推荐答案

你应该在指定路径之前放下面的代码

You should put the below code before you specify the path
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);



希望这有帮助


Hope this helps


这篇关于输入类型文件在服务器上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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