使用 Asp.Net FileUpload 控件时,上传的文件在保存之前位于何处?

发布于 2025-01-02 21:57:58 字数 333 浏览 0 评论 0原文

当您在调用 SaveAs() 方法之前BUT上传文件时,我试图确定 Asp.Net 和/或 IIS 存储文件上传的位置。

我查看了 MSDN ,我很喜欢知道它在内存中而不是放在文件系统上,但我在任何地方都找不到它明确说明的地方。

我正在尝试向 IT 人员验证上传的文件(其流将传递到 FTP,而无需调用 SaveAs())不会被我们的服务器复制系统自动复制。

I am trying to determine where Asp.Net and/or IIS store file uploads when you upload a file BUT before you call the SaveAs() method.

I looked on MSDN and I kind of get the idea that it's in memory and not put on the file system, but I can't find it anywhere it says this explicitely.

I am trying to verify to IT that uploaded files (whose streams are passed on to FTP without ever calling SaveAs()) will not be automatically replicated by our server replication system.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幻想少年梦 2025-01-09 21:57:58

以下内容来自 如何更改 ASP.NET 2.0 FileUpload 控件的默认 TempFile 上传位置?

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.

编译元素(ASP.NET 设置架构) 显示编译元素,其中 tempDirectory 属性保存上传过程中临时文件的位置。

The following is from 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) shows the compilation element where the tempDirectoryattribute holds the location for the temp files while a upload is in progress.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文