如何上传特定目录中的文件 [英] How to upload a file in a specific directory

查看:87
本文介绍了如何上传特定目录中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

任何人都可以告诉我如何将文件上传到特定目录。我正在使用ASP.NET Fileupload组件。我想允许用户将文件上传到目录或子目录。根据他们的选择,他们可以上传到任何文件夹。如何在我的Web应用程序中跟踪用户是否在特定文件夹中?他上传的文件上传到正确的文件夹或子文件夹???谢谢。

Hi Everyone,
can anyone please let me know how to upload a file to a specific directory. I am using ASP.NET Fileupload component. I want to allow user to upload files to a directory or a sub directory. Depending upon their choice, they can upload in any folder. How can I trace in my web application that a user is in a particular folder & the document he uploads get uploaded in the correct folder or sub folder??? Thanks.

推荐答案

实际上我想创建像应用程序一样的FTP,用户可以在其中制作,删除,重命名目录&随后上传任何目录中的文件。任何提示或帮助将不胜感激。谢谢。
Actually I want to create FTP like application, where users can make, delete, rename directories & subsequently upload files in any of the directory. Any hint or help will much be appreciated. Thanks.


考虑使用TreeView控件来显示目录层次结构。您可以添加一些按钮以将子目录添加到所选节点。并且您可以使用FileUpload控件将上传的文件保存到所选目录。


如果您稍微修改一下以显示文件,您可以使用一个按钮来删除所选文件。


这不是一个简单的项目,但它也不应该太难。
Consider using a TreeView control to show your directory hierarchy. You could add some buttons to add a child directory to the selected node. And you could have a FileUpload control that will save the uploaded file to the selected directory.

If you modify this a little bit to show files, you could have a button to delete a selected file.

This isn''t going to be a simple project, but it shouldn''t be too hard either.


感谢InsertAlias期待你的答复。我已经放置了一个TreeView控件来显示我的主目录结构。我在它前面的GridView中显示每个目录的文件。但是我无法理解,我在哪里放置在所选节点中创建目录的按钮,并在其中上传文件?有没有办法可以在TreeView或GridView中添加一个按钮并放入FileUpload?
Thanks InsertAlias for your reply. I have put a TreeView control to show my main directory structure. I show the files of each directory in a GridView infront of it. However I am unable to understand, where do I put the button which create directory in the selected node and also upload files in it?? Is there a way that I can add a button in TreeView or GridView and put FileUpload as well??


这篇关于如何上传特定目录中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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