艺术迷网
艺术迷 >> 网页设计 >> 其它教程 >> ASPUpload组件的使用方法->更改前缀
2006-9-14   作者:佚名   来源:艺术迷收集(fansart.com)   点击:2313
页面功能: 【评论】有错就点】 【字体: 】 【打印】 【关闭【收藏本页】收藏到365Key
 
方法一:
Set Upload = Server.CreateObject("Persits.Upload")

' Prevent overwriting
Upload.OverwriteFiles = False

' We use memory uploads, so limit file size
Upload.SetMaxSize 1000000, true

' Save to memory
Upload.Save

' Use session ID as the new file name
NewName = Session.SessionID

For Each File in Upload.Files
File.SaveAs "c:\upload\" & NewName & File.ext
Response.Write "New name: " & File.FileName & "<BR>"
Next


--------------------------------------------------------------------------------------------------------------------->
方法二:

Set Upload = Server.CreateObject("Persits.Upload")

' Prevent overwriting
Upload.OverwriteFiles = False

' Save to disk
Upload.Save "c:\upload"

' Use session ID as the new file name
NewName = Session.SessionID

For Each File in Upload.Files
File.Copy "c:\upload\" & NewName & File.ext
File.Delete
Response.Write "New name: " & NewName & File.ext & "<BR>"
Next


有关ASPUpload的组件

文件改名的两种方法.
声明:本站刊载此文不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。如有疑问请与站长联系。
网友评论
目前没有评论!
发表评论
您的姓名: 匿名发送
电子邮件:
评论内容:
不能超过100个字符



所有留言只代表网友个人观点,不代表本站观点。
请各位遵纪守法并注意语言文明。
新闻搜索
关 键 词:
搜索范围:
全站精华
图文精彩