如何使用ASP .NET 3.5中的Fileupload Control将.zip文件存储在项目的文件夹中 [英] how to store the .zip file in the project's folder using Fileupload Control in asp .net 3.5
问题描述
大家好
我只想将.zip文件存储在名为SampleContent的项目文件夹中.
到目前为止,我已经处理过图像并将其转换为字节并存储到数据库中.如何通过上传控件将文件存储在物理文件夹中.
我想读取.zip文件中的文件以获取文件名.
任何帮助将不胜感激.
非常紧急.
问候
Froxy
Hi All
I just want to store the .zip files in my project folder called SampleContent.
So far i have worked with images and converting them as bytes and storing into database.How can i store the files in physical folder from the upload control.
And I want to read the files inside the .zip files to get the file names.
Any help would be appreciated.
It is very urgent.
Regards
Froxy
推荐答案
string path = Server.MapPath("/SampleContent");
FileUpload.SaveAs(Path.COmbine(path, FileUpload.PostedFile));
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.saveas.aspx [
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.saveas.aspx[^]
这篇关于如何使用ASP .NET 3.5中的Fileupload Control将.zip文件存储在项目的文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!