Flajaxian 上傳元件(一次選擇多個上傳)
官方說明書
http://www.flajaxian.com/flajaxian.com/FileUploader2.0Help.html#RequestLimitations
影片教學(就感心ㄟ)
http://blog.bodurov.com/how-to-use-flajaxian-fileuploader-video-basics
重點要先下載 Flajaxian 的DLL檔案
http://flajaxianfileupload.codeplex.com/
第一步驟 下載 com.flajaxian.FileUploader 檔案回來後
加入參考到你的website內
第二步驟 在要上傳的頁面加入這行
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>
第三步驟
<fjx:FileUploader ID="FileUploader1" runat="server" onfilereceived="FileUploader1_FileReceived" >
<Adapters>
<fjx:FileSaverAdapter Runat="server" />
</Adapters>
</fjx:FileUploader>
頁前改完後差不多就長這樣就算設定完了
第四步驟 先加入一個資料夾(名稱為UploadFolder)
後面的程式碼
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void FileUploader1_FileReceived(object sender, com.flajaxian.FileReceivedEventArgs e)
{
string servpath = Server.MapPath(@"UploadFolder\");
e.File.SaveAs(servpath + e.File.FileName);
SqlDataSource1.InsertCommand = "INSERT INTO book (book_image) VALUES ('"+ e.File.FileName.ToString() +"')";
SqlDataSource1.Insert();
}
}
小弟只做初步探索,更深入設定說明書內也有說明怎樣設定
有興趣大一起切磋切磋
大家一起加入blogads 賺零用錢!!