點選超連結彈出乙個上傳檔案的視窗

2021-09-30 06:30:07 字數 872 閱讀 8033

方法一:

w3c處於安全性考慮,並沒有為type為file的input空間指定onclick事件(ie不怎麼按w3c標準辦事兒)。

但是我們可以通過css技術來模擬這個功能,前提是你的瀏覽器支援半透明效果(opacity)

以下是給你的示例(firefox, ie和google chrome下測試均通過):

html code

<

style

>

div.fileinputs

div.fakefile

input.file

style

>

<

div

class

="fileinputs"

>

<

input

type

="file"

class

="file"

/>

<

div

class

="fakefile"

>

<

a href

=""onclick

="return false;"

>

click me

div>

div>

方法二:

點選超連結,將頁面中某個資料傳到另乙個頁面

test 1234567890 測試二使用cookie儲存資料,在別的頁面獲取cookie值 使用localstorage儲存資料,在別的頁面獲取值 讀取url攜帶的資料時,還有另外一種方法 function getrequest return therequest var request new ...

C 上傳檔案的乙個實現

c 上傳檔案的乙個實現 using system using system.data using system.data.sqlclient using ca.components 全部在元件命名空間下 namespace ca.components catch exception exec dou...

C 上傳檔案的乙個實現

c 上傳檔案的乙個實現 iis5中測試通過 引數為頁面的file控制項物件 public static string uploadfile htmlinputfile file catch exception exec double unit 1024 double size math.round ...