asp.net中的文件上传异常c# [英] file upload exception in asp.net wit c#

查看:100
本文介绍了asp.net中的文件上传异常c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我试图在asp.net中多次上传同一个文件时,在fileupload控件的帮助下它会重新发生异常





进程无法访问文件'D:\ myfileupload \Files \users.xlsx',因为它正由另一个进程使用。



如何解决这个错误!

提前谢谢...

Hi,
when i am trying to upload the same file multiple times in asp.net with the help of fileupload control it reurns an exception
i.e.

The process cannot access the file 'D:\myfileupload\Files\users.xlsx' because it is being used by another process.

how to resolve this error!
Thanks in advance...

推荐答案

听起来像你将相同的文件保存到同一个地方。您需要使用不同的名称保存每个。
It sounds like you are saving the same files to the same place. You'll need to save each one with a different name.


当您尝试上传相同的文件时。

确保您已经处理了所有(excel)与该文件相关的对象。



如何正确清理excel-interop-objects [ ^ ]
When you are trying to upload the same file.
make sure that you have disposed all the (excel) object related to that file.

how-to-properly-clean-up-excel-interop-objects[^]


这篇关于asp.net中的文件上传异常c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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