国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

關于大文件上傳的FTP解決方案

2024-07-21 02:15:43
字體:
來源:轉載
供稿:網友
    用asp.net上傳文件時,對大文件的處理總會不盡于人意,雖然從理論上講,可以傳輸很大的文件(100m以上),但在實際使用中會出現各種問題.因此,基于b/s架構的大文件上傳還是用ftp為好。

 用ftp手工上傳文件沒有什么可以說的,但我們往往需要通過程序來控制這一過程,即通過asp.net來實現這一目的.如果ftp軟件具備可二次開發的接口就好了.經典的cuteftp pro就具有這樣的功能。

 安裝完cuteftp pro 7后,會生成一個文件叫ftpte(ftp傳輸引擎),ftpte提供了很多屬性和方法,能夠方便地通過編程來實現大文件的上傳,包括文件過濾、目錄和文件檢測、文件刪除、改名、傳輸啟動和停止以及狀態查看等等。

 下面是實例:

 連接ftp服務器:

set mysite = createobject("cuteftppro.teconnection")

mysite.protocol = "ftp"

mysite.host = "ftp.cuteftp.net"

mysite.login = "username"

mysite.password = "password"

mysite.connect

 上傳文件:

set mysite = createobject("cuteftppro.teconnection")

‘specify user, pass, host, and connect as normal...

mysite.connect ‘recommended: call connect first

mysite.remotefolder = "temp"

mysite.localfolder = "c:/123"

‘using relative path, all files in folder 123 are uploaded to the folder temp off the current folder on the server.

mysite.upload "*.*"

 下載文件:

set mysite = createobject("cuteftppro.teconnection")

‘specify user, pass, host, and connect as normal...

mysite.connect ‘recommended: call connect first

‘next line changes to a predetermined folder so you can use a relative path in the download method

mysite.remotefolder = "/c:/inetpub/ftproot/temp/temp/"

msgbox (mysite.remotefolder) 'display current remote folder

mysite.download "agent.ini", "c:/temp/agent1.ini"

'now verify downloaded ok

if cbool(mysite.localexists ("c:/temp/agent1.ini")) then

msgbox "file downloaded ok."

end if

 從實驗的情況看,ftpte在c/s模式下能很好的支持各項功能,在b/s模式下會找不到組件,可能與沒有注冊有關。

 通過利用ftpte,可能編程實現遠程文件定時或不定時同步等諸多功能,從而實現非手工方式的文件傳輸。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 威海市| 滦南县| 桦南县| 苏尼特右旗| 阿拉善右旗| 恭城| 安达市| 东方市| 清涧县| 手游| 岗巴县| 乐都县| 准格尔旗| 华安县| 新竹县| 潼南县| 余江县| 延长县| 孝义市| 济南市| 桃园县| 五原县| 富阳市| 新宁县| 沙田区| 图木舒克市| 鄂州市| 毕节市| 大渡口区| 韶关市| 隆回县| 双鸭山市| 二连浩特市| 枝江市| 湘阴县| 泾阳县| 无极县| 湾仔区| 工布江达县| 河间市| 广德县|