FTB3图片上传
2007-06-13  作者:amao  同分类文章
description:

FreeTextBox使用详解

Author: Annerose     Date:12/16/2005

版本: FreeTextBox 3.1.1  ASP.NET1.1

1.下载 FreeTextBox 3.1.1 (released 2005/11/08)

http://www.freetextbox.com/downloads.aspx

图片上传
官方wiki
http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ImageGallery


1) 工具栏上添加ImageGallery按钮.
<FTB:FreeTextBox ..ToolbarLayout=" ..,InsertImageFromGallery,.. />

2) 拷贝 "ftb.imagegallery.aspx" 文件到同一目录下

3) FreeTextBox 属性设置

  • ImageGalleryPath = if your images are located at http://www.mysite.com/images/ and the script with FreeTextBox is http://www.mysite.com/admin/edit.aspx, you should set ImageGalleryPath="~/images/". This setting follows normal .NET syntax for use of absolute and relative paths.
  • ImageGalleryUrl = this is the URL to the page where the ImageGallery control resides. This does not need to be changed unless you want to store ftb.imagegallery.aspx in a location other than the same folder in which the originating FreeTextBox page resides


ImageGalleryPath = "~/image/upload"  上传默认路径
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}"  ftb.imagegallery.aspx的目录, 只能用相对目录,不可以用"~"

4) ImageGallery 的设置
ftb.imagegallery.aspx文件里

<FTB:ImageGallery id="ImageGallery1"
JavaScriptLocation
="InternalResource" UtilityImagesLocation="InternalResource"
SupportFolder
="~/aspnet_client/FreeTextBox/"
AllowImageDelete
=true
AllowImageUpload=true 
AllowDirectoryCreate=false 
AllowDirectoryDelete=false 
runat="Server" />

AllowDirectoryCreate - 能否建立文件夹
AllowDirectoryDelete - 能否删除文件夹
AllowImageUpload - 能否上传图片
AllowImageDelete - 能否删除图片
AcceptedFileTypes - 可以上传文件扩展名的数组(array)

为开发者提供的2个属性

CurrentDirectories - a string[] array of directories to allow the user to navigate toward
CurrentImages - a FileInfo[] array of files the user should be able to insert.

建议: 删掉Page_Load事件可以显著回避上传图片不能即时显示的问题. 不要重写Page_Load

That's all. Thanks



相关
基于asp.net的blog程序已经开发好了
using Statement 用法 (C# Reference)
chm文档的右边内容是空白
128M ram 的vps太容易坏了。
浅析C#(.net)中的套接字socket编程
"Orcas" Mar07CTP体验DLINQ
Expression Web 简体中文正式版序列号
WPF与Win32图形系统
几个.net开源项目
sql server , mysql , sqlite 的时间字段的默认值