汉语大全>初中二年级作文>web,uploader使用教程

web,uploader使用教程

详细内容

篇一:《ASPFSO操作文件(复制文件、重命名文件、删除文件、替换字符串)》

FSO的意思是FileSystemObject,即文件系统对象。FSO对象模型包含在

Scripting类型库(Scrrun.Dll)中,它同时包含了Drive、Folder、File、

FileSystemObject和TextStream五个对象,用来操作文件和文件夹十分方便。(请注意后面的常用函数)

FSO文件(File)对象属性

DateCreated返回该文件夹的创建日期和时间

DateLastAessed返回最后一次访问该文件的日期和时间

DateLastModified返回最后一次修改该文件的日期和时间

Drive返回该文件所在的驱动器的Drive对象

Name设定或返回文件的名字

ParentFolder返回该文件的父文件夹的Folder对象

Path返回文件的绝对路径,可使用长文件名

ShortName返回DOS风格的8.3形式的文件名

ShortPath返回DOS风格的8.3形式的文件绝对路径

Size返回该文件的大小(字节)

Type如果可能,返回一个文件类型的说明字符串

FSO文件(File)对象方法

FSO文件对象方法用途

CopyFile拷贝一个或者多个文件到新路径

CreateTextFile创建文件并且返回一个TextStream对象

DeleteFile删除一个文件

OpenTextFile打开文件并且返回TextStream对象,以便读取或者追加

重命名文件:

FunctionreName(sourceName,destName)

dimoFso,oFile

setoFso=server.createobject("Scripting.FileSystemObject")

setoFile=oFso.getFile(Server.mappath(sourceName))

oFile.Name=destName

SetoFso=Nothing

SetoFile=Nothing

EndFunction

删除文件:

FunctionFSOdel(fileName)

dimfso,f

setfso=server.CreateObject("scripting.filesystemobject")

f=server.MapPath(fileName)

iffso.FileExists(f)then

fso.DeleteFilef,true

endif

setf=nothing

setfso=nothing

EndFunction

替换文件中的字符串:

FunctionFSOreplace(fileName,Target,repString)

DimobjFSO,objCountFile,FiletempData

SetobjFSO=Server.CreateObject("Scripting.FileSystemObject")

SetobjCountFile=objFSO.OpenTextFile(Server.MapPath(fileName),1,True)FiletempData=objCountFile.ReadAll

objCountFile.Close

FiletempData=Replace(FiletempData,Target,repString)

SetobjCountFile=objFSO.CreateTextFile(Server.MapPath(fileName),True)objCountFile.WriteFiletempData

objCountFile.Close

SetobjCountFile=Nothing

SetobjFSO=Nothing

EndFunction

<%

'*******************************************************

'函数名:CreateFolder(sPath)

'作用:创建目录

'参数:sPath:创建的相对目录路径

'返回值:成功true,失败false

'*******************************************************

'response.Writecreatefolder("/dgsunshine/UploadFile/demo1/")FunctionCreateFolder(sPath)

OnErrorResumeNext

DimFso,Arrfolder,Folder,i,j

IfsPath=""then

CreateFolder=False

ExitFunction

EndIf

IfLeft(sPath,1)="/"Then

Folder="/"

sPath=Mid(sPath,2,Len(sPath))

Else

Folder="./"

EndIf

ifRight(sPath,1)="/"thensPath=Left(sPath,Len(sPath)-1)ArrFolder=Split(sPath,"/")

SetFso=Server.CreateObject("Scripting.FileSystemObject")

Fori=0ToUbound(ArrFolder)

Ifi=0then

Folder=Folder&ArrFolder(i)&"/"

Else

Folder=Folder&ArrFolder(i)&"/"

EndIf

IfFso.folderExists(Server.MapPath(Folder))=Falsethenresponse.Writeserver.MapPath(folder)

Fso.createFolder(Server.MapPath(Folder))

EndIf

Next

SetFso=nothing

IfErr.Number<>0then

Err.clear()

CreateFolder=False

Else

CreateFolder=True

EndIf

Endfunction

FunctiongetFile(paramFilePath)

SetFso=Server.CreateObject("Scripting.FileSystemObject")SetFso_Read=

fso.OpenTextFile(Server.MapPath(paramFilePath),1,false,-2)

getFile=Fso_Read.readall

SetFso_Read=Nothing

SetFso=Nothing

EndFunction

'*******************************************************'函数名:CreateFile(paramFileContent,paramFilePath)

'作用:创建文件

'参数:paramFileContent'文件的内容

'paramFilePath'文件名(不包括路径)

'返回值:成功true,失败false

'*******************************************************FunctionCreateFile(paramFileContent,paramFilePath)

OnErrorResumeNext

DimFso,fWrite

SetFso=Server.CreateObject("Scripting.FileSystemObject")SetfWrite=

Fso.CreateTextFile(Server.Mappath(paramFilePath),true)

fWrite.writeparamFileContent

fWrite.close(){web,uploader使用教程}.

SetfWrite=nothing

SetFso=nothing

IfErr.number<>0Then

Err.clear()

CreateFile=False

Else

CreateFile=True

EndIf

EndFunction

'*******************************************************'函数名:DelFile(FilePath)

'作用:删除文件

'参数:FilePath'文件路径多个文件用"|"隔开

'返回值:成功true,失败false

'*******************************************************FunctionDelFile(FilePath)

OnErrorResumeNext

Dimfso,arrFile,i

IfGetSafeStr(FilePath,"")=""then

CreateFolder=false

ExitFunction

EndIf

arrFile=Split(FilePath,"|")

SetFso=Server.CreateObject("Scripting.FileSystemObject")

fori=0toUBound(arrFile)

FilePath=arrFile(i)

IfFso.FileExists(Server.MapPath(FilePath))thenFso.DeleteFileServer.MapPath(FilePath)

EndIf

Next

Setfso=nothing

篇二:《标签需求、设计说明书》

文件上传

标签用途和功能介绍

1.

2.

3.

4.支持多个文件上传对上传文件进行增加、删除、删除所有等操作对上传文件前检测同名文件,以及上传文件的大小限制包含中文名称的文件上传、附件上传成功后,在数据库表中插入一条记录,记录信

息包括一个随机字符的字段,在下载时候通过该字段找到相应的附件

5.上传文件时候,反映上传进度

界面设计说明

对上传操作的页面显示做了以下人性化操作:

1、可以任意在上传多个文件,只需在一个上传文件的输入框中完成

2、上传前在不访问数据库的前提下,进行增加、删除、删除所有等操作

3、在上传文件前检测同名文件,以及上传文件的大小

4、上传文件时候,可以在页面反映出:

1.等待上传的文件列表

2.正在上传文件的文件名,以及进度百分比和进度条

3.已经上传文件的文件列表

操作说明

武汉贝斯特软件技术有限公司Page1of2

代码说明

类文件

/bestsoft/ssh/m//upload/UploadTag.java封装了在jsp页面显示的html标签

/bestsoft/ssh/web/action/upload/UploadFileAction.java封装了上传文件的方法

jsp文件

WEB-INF/jsp/upload/percent-ajax.jsp封装进度条的显示

WEB-INF/jsp/upload/upload-ajax.jsp封装选择上传文件的操作

文件

js/upload/upload.js封装上传文件的脚本程序

其他文件

WEB-INF/tld/upload包下所有文件.tld文件(设置标签属性)

武汉贝斯特软件技术有限公司Page2of2

篇三:《uploadify教程》

Uploadify使用说明

什么是Uploadify

原文:UploadifyisajQuerypluginthatintegratesafully-customizablemultiplefileuploadutilityonyourwebsite.ItusesamixtureofJavascript,ActionScript,andanyserver-sidelanguagetodynamicallycreateaninstanceoveranyDOMelementonapage.

译文:Uploadify是一个jQuery插件,集成了一个完全可定制的多个文件上传您的网站上的效用。它混合使用的Javascript,ActionScript,和任何服务器端语言来动态创建的任何一个页面上的DOM元素的一个实例。

原文:UploadifywasbornoutoftheneedforamultiplefileuploadutilityforaCMSthatwas

beingdeveloped.Afterevaluatingtheotheravailableoptions,RonnieSandecidedthebestoptionwastobuildanewplug-inandmakeitavailabletothedevelopmentmunity.Inordertomaketheplug-ineasytoimplementandhighly-customizable,thejQueryformatwaschosen.Afterwordgotout,thepopularityoftheplug-inspawnedtheneedforadedicatedsite.TravisNickelsvolunteeredhishelptorefiheUploadifyplug-inandmakeitwhatitistoday.

译文:CMS开发后,需要实现多文件上传功能,这样,Uploadify这个实用工具诞生了。经过评过其他可用选项,RonnieSan决定创建一个新的插件提供给开发社区。为了使这个插件容易实施,并可高度定制,最后选择了Jquery.消息传出后,这个插件的普及,使其需要一个专门的网站来提供支持。TravisNickels自告奋勇的去帮助和完善Uploadify插件。这就是我们今天看到的这个网站。

Uplodify的特点{web,uploader使用教程}.

怎么使用Uploadify

原文:Uploadifywascreatedtobeaneasy-to-implementsolutionformultiplefileuploads.AsajQueryplugin,theUploadifyimplementationissimpleandhighly-customizable.

WhileitmayrequireafoundationalknowledgeofjQuerytosuessfullyimplement,thisdocumentationshouldprovideaprehensiveenoughreferenceforthosewhoarehavingtrouble.Ifyouarerunningintoissuesthatthisdocumentationcan'thelpsolve,thereisanactivemunityofUploadifyusersthatcanbeaessedthroughthe.Inaddition,we'veprovidedalistofthatmayalsoaidintroubleshootingyourUploadifyinstance

译文:

Uploadify是一个简单易用的多文件上传方案。作为一个Jquery插件,Uploadify使用简单,并具有高度的定制性。

正常使用Uploadify插件需要一些Jquery基础知识。为了减少使用问题,本文档提供了足够全面的参考知识。如果该文档不能解决你在使用中遇到的问题,请访问论坛()获取更多信息。此外,我们提供了常见问题列表,也许这些信息也能帮助你解决Uploadify在使用中遇到的问题。

示例代码

头文件引入

使用Uploadify插件需要引入uploadify.css、jquery.js、swfobjects.js、和uploadify.js等4个文件

HTML文件

如果只是实现简单的文件上传功能,只需要在body里,添加一个file。Js代码

$(document).ready(function(){$("#up_file").uploadify({

'uploader':'/uploadify/uploadify/uploadify.swf','script':'/uploadify/UploadifyHandler.ashx','cancelImg':'/uploadify/uploadify/cancel.png','folder':'/upload','auto':true,

'multi':true});});

事件

1、onAllplete:当队列中所有文件上传完成后触发。示例

„onAllplete‟:function(event,data){….}event:事件对象(theeventobject)示例{web,uploader使用教程}.

„onCancel‟:function(event,ID,fileObj,data){…}event:事件对象(theeventobject)ID:被取消的文件的唯一标识

2、onCancel:当队列中的每个文件别移除时触发

示例:function(event,data,key){。。。。}event:事件对象(theeventobject)

3、onCheck:上传开始前,如果发现有同名的文件存在则触发该事件。

data:包含服务器段所有文件名称的一个列表。每个文件的关键字是队列中的唯一标识。key:用户服务器段检测的唯一标识

4、onClearQueue:当uploadifyClearQueue()方法调用时触发示例:‟onClearQueue