开发者

HttpPostedFileBase.SaveAs method question

I've got an asp.net mvc application that uploads a file and stores them in one of the directories where the websit开发者_开发技巧e is located.

My question is... When you execute HttpPostedFileBase.SaveAs() method saving it with the same name as an existing filename on the folder, does HttpPostedfileBase overwrite the file?

Thanks a million!


Yes. Any existing file will be overwritten. (I checked the source)


HttpPostedFileBase is just an abstract base class - what SaveAs does depends on the implementation. However, it's clearly meant to abstract HttpPostedFile, and that will overwrite any files at the target location - if it can (i.e. has the appropriate permissions).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜