如何在asp.net 4.0中上载文件夹并显示包含文件并使用Progressbar上载ftp [英] How to uploading a folder and show contain files and upload ftp with progressbar in asp.net 4.0
问题描述
大家好.........
我只是asp.net的初学者..
在我的项目中,(1)我必须上载音乐mp3文件夹.在这里,我使用asp.net上传控件,我只能选择一个文件,而不能选择文件夹.因此,我将如何实现这一目标.
(2).选择并上传音乐文件夹后,我想显示asp.net页上上传的文件夹中包含的所有音乐文件(mp3歌曲).
(3)然后我想将此歌曲文件上传(保存)到服务器(ftp)
(4)我也想在上传过程中使用进度条.
所以,请回答我的问题...
想了很多
问候
昂昂
(缅甸)
Hi all .........
I am just beginner in asp.net..
In my project, (1) i have to upload music mp3 folder . here i use asp.net upload control and i can only select a file , i can''t select folder. So, how will i do to achieve this.
(2). After select and upload the music folder, i want to show all music file (mp3 songs) contain in uploaded folder on asp.net page..
(3) Then i want to upload(save) this songs file to server (ftp)
(4) I also want to use progress bar in uploading process.
So , please answer my questions...
and think a lot
Regard
Naing Aung
(Myanmar)
推荐答案
您拥有这首音乐,使用服务器的所有人也都拥有吗?
您无法在ASP.NET中做您想做的事情.您需要使用Flash或Java或.NET或C ++编写控件,将其托管在您的页面中,并让它们执行这些操作. HTML无法执行您列出的任何操作.它无法执行FTP,无法浏览或选择文件夹,并且无法显示进度栏.
You own this music, and so does everyone using your server ?
You can''t do what you want in ASP.NET. You need to write a control in flash or java or .NET or C++, host it in your page, and have it do these things. HTML can''t do anything you listed. It can''t do FTP, it can;t browse or choose folders, and it can''t show a progress bar.
您所能做的就是上传文件集(但而不是目录).上传文件后,可以使用ASP.NET服务器端代码将它们进一步移动.例如,对于FTP,将System.Net.WebRequest
与URI的FTP类型一起使用.请求的运行时类型为System.Net.FtpWebRequest
,将通过工厂方法System.Net.WebRequest.Create
基于URL创建.
在此处查看一些示例代码: http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx [ ^ ].
另请参阅: http://msdn.microsoft.com/en-us/library/system .net.webrequest.aspx [ ^ ].
我认为您无法使用进度条来跟踪客户端中文件上传的进度.据我所知,HTTP服务器将HTTP文件上传视为一个一步的过程,不会通知您.我也从未在网站上看到这种行为.进度条是相当可行的,但恐怕无法显示相关状态.
—SA
All you can do is uploading set of files (but not a directory) using HTTP. When the files are uploaded, you can move them further using ASP.NET server-side code. For FTP, for example, useSystem.Net.WebRequest
with FTP type of URI. The run-time type of request will beSystem.Net.FtpWebRequest
, it will be created based on URL via the factory methodSystem.Net.WebRequest.Create
.
See some sample codes here: http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^].
See also: http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[^].
I don''t think you can use a progress bar to track the progress of file upload in the client side. To best of my knowledge, HTTP servers treat HTTP file upload as a one-step process giving you no notification. I also never saw such behavior on Web sites. A progress bar is quite doable, but I afraid showing relevant status in it is not possible.
—SA
这篇关于如何在asp.net 4.0中上载文件夹并显示包含文件并使用Progressbar上载ftp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!