作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当您上传文件时,我试图确定 Asp.Net 和/或 IIS 将文件上传存储在何处但是,然后再调用 SaveAs()
方法。
我看了MSDN我有点明白它在内存中而不是放在文件系统中,但我在任何明确说明这一点的地方都找不到它。
我正在尝试向 IT 部门验证我们的服务器复制系统不会自动复制上传的文件(其流会传递到 FTP,而无需调用 SaveAs()
)。
最佳答案
以下内容来自How to change the default TempFile upload location for the ASP.NET 2.0 FileUpload control?
Dumping out the HttpRawUploadedContent from a memory dump, I can see that the file is buffered in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\fileupload20\d909613c\d78e07ba\uploads files folder and is called f-zqaz-r.post
0:008> !do 017c3fbc
Name: System.Web.HttpRawUploadedContent+TempFile
MethodTable: 68a870e0
EEClass: 68a87070
Size: 20(0x14) bytes
GC Generation: 0
(C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll)
Fields:
MT Field Offset Type VT Attr Value Name
7a754a14 4000fb0 4 ...empFileCollection 0 instance 017c4944 _tempFiles
790fa3e0 4000fb1 8 System.String 0 instance 017c54e4 _filename
790fe3c8 4000fb2 c System.IO.Stream 0 instance 017c55f8 _filestream
0:008> !do 017c54e4
Name: System.String
MethodTable: 790fa3e0
EEClass: 790fa340
Size: 262(0x106) bytes
GC Generation: 0
(C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
String: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\fileupload20\d909613c\d78e07ba\uploads\f-zqaz-r.post
If you want to change the default location, The tempDirectory attribute of the <compilation> element allows you to specify the directory to use for temporary file storage during compilation. The default is an empty string (""). In the case of an empty string, and if the current process has the required access permissions, the files are stored in the %FrameworkInstallLocation%\ Temporary ASP.NET Files directory.
compilation Element (ASP.NET Settings Schema)显示 compilation
元素,其中 tempDirectory
属性在上传过程中保存临时文件的位置。
关于c# - 使用 Asp.Net FileUpload 控件时,上传的文件在保存之前位于何处?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9136237/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!