當前位置:首頁 » 文件管理 » 圖片上傳組件

圖片上傳組件

發布時間: 2022-01-30 09:41:42

『壹』 急求一個圖片上傳控制項

謝謝樓上的回帖,但是你寫的這個功能,我可以實現的,關鍵就是怎麼可以在預覽中,有一個框,可以調整這個框的大小,只要被這個框選中的區域,點一下確認後,就可以生產一個選中區域的圖片,就是校內上傳頭像的那個控制項或者是方法。在這里我還是要感謝一下樓上的代碼。謝謝你了啊!!在線等,我很急的啊!!!

『貳』 火狐瀏覽器需要下載什麼組件才能看實現富文本編輯器的多張圖片上傳

多數是調用UEditor的圖片上傳組件進行圖片上傳,火狐里開發者相關的擴展太多了,但是使用人數特別多的也就那幾種,在火狐擴展中心根據分類,用戶數量查看下,然後按需要選擇。

『叄』 上傳圖片控制項的問題

剛了你的代碼,運行了一下,沒有發現你說的問題,點擊瀏覽之後,文本框中會保留路徑,在點擊div後文本框中的值會改變,但不會情空文本框,敢問你用的IE版本是那個,是否是因為存在瀏覽器兼容性問題

『肆』 通過組件上傳圖片後,怎麼得到圖片的地址

圖片地址=域名+本地保存路徑文件名
以http://ewebeditor.webasp.net/Example/I_Upload.asp
那麼圖片地址就是
http://ewebeditor.webasp.net/本地保存路徑文件名(復制框里的內容)

『伍』 可以用javascript控制flash圖片上傳組件進行圖片上傳嗎

不能!flash圖片上傳那個flash是用actionscription語言寫出來的。

『陸』 asp中上傳圖片的組件,

4個文件實現無組件上傳4個文件實現無組件上傳
嵌套式調用:
<iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src=uploada.asp></iframe>

直接鏈接:uploada.asp
文件保存路徑:upload
上傳文件類型和大小自己設置

===========================================
第一個文件:inc/confing.asp(inc為文件夾名稱)
<%
Const EnableUploadFile="Yes" '是否開放文件上傳
Const MaxFileSize=200 '上傳文件大小限制
Const UpFileType="gif|jpg|bmp|png|swf|doc|txt|rar|zip" '允許的上傳文件類型
%>

===========================================
第二個文件:inc/upload.asp

dim oUpFileStream

Class upload_file

dim Form‚File‚Version

Private Sub Class_Initialize
'定義變數
dim RequestBinDate‚sStart‚bCrLf‚sInfo‚iInfoStart‚iInfoEnd‚tStream‚iStart‚oFileInfo
dim iFileSize‚sFilePath‚sFileType‚sFormvalue‚sFileName
dim iFindStart‚iFindEnd
dim iFormStart‚iFormEnd‚sFormName
'代碼開始
Version="無組件上傳類 Version 0.96"
set Form = Server.CreateObject("scripting.Dictionary")
set File = Server.CreateObject("scripting.Dictionary")
if Request.TotalBytes < 1 then Exit Sub
set tStream = Server.CreateObject("adodb.stream")
set oUpFileStream = Server.CreateObject("adodb.stream")
oUpFileStream.Type = 1
oUpFileStream.Mode = 3
oUpFileStream.Open
oUpFileStream.Write Request.BinaryRead(Request.TotalBytes)
oUpFileStream.Position=0
RequestBinDate = oUpFileStream.Read
iFormEnd = oUpFileStream.Size
bCrLf = chrB(13) & chrB(10)
'取得每個項目之間的分隔符
sStart = MidB(RequestBinDate‚1‚ InStrB(1‚RequestBinDate‚bCrLf)-1)
iStart = LenB (sStart)
iFormStart = iStart+2
'分解項目
Do
iInfoEnd = InStrB(iFormStart‚RequestBinDate‚bCrLf & bCrLf)+3
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iFormStart
oUpFileStream.CopyTo tStream‚iInfoEnd-iFormStart
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sInfo = tStream.ReadText
'取得表單項目名稱
iFormStart = InStrB(iInfoEnd‚RequestBinDate‚sStart)-1
iFindStart = InStr(22‚sInfo‚"name="""‚1)+6
iFindEnd = InStr(iFindStart‚sInfo‚""""‚1)
sFormName = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
'如果是文件
if InStr (45‚sInfo‚"filename="""‚1) > 0 then
set oFileInfo= new FileInfo
'取得文件屬性
iFindStart = InStr(iFindEnd‚sInfo‚"filename="""‚1)+10
iFindEnd = InStr(iFindStart‚sInfo‚""""‚1)
sFileName = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
oFileInfo.FileName = GetFileName(sFileName)
oFileInfo.FilePath = GetFilePath(sFileName)
oFileInfo.FileExt = GetFileExt(sFileName)
iFindStart = InStr(iFindEnd‚sInfo‚"Content-Type: "‚1)+14
iFindEnd = InStr(iFindStart‚sInfo‚vbCr)
oFileInfo.FileType = Mid (sinfo‚iFindStart‚iFindEnd-iFindStart)
oFileInfo.FileStart = iInfoEnd
oFileInfo.FileSize = iFormStart -iInfoEnd -2
oFileInfo.FormName = sFormName
file.add sFormName‚oFileInfo
else
'如果是表單項目
tStream.Close
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iInfoEnd
oUpFileStream.CopyTo tStream‚iFormStart-iInfoEnd-2
tStream.Position = 0
tStream.Type = 2
tStream.Charset = "gb2312"
sFormvalue = tStream.ReadText
form.Add sFormName‚sFormvalue
end if
tStream.Close
iFormStart = iFormStart+iStart+2
'如果到文件尾了就退出
loop until (iFormStart+2) = iFormEnd
RequestBinDate=""
set tStream = nothing
End Sub

Private Sub Class_Terminate
'清除變數及對像
if not Request.TotalBytes<1 then
oUpFileStream.Close
set oUpFileStream =nothing
end if
Form.RemoveAll
File.RemoveAll
set Form=nothing
set File=nothing
End Sub

'取得文件路徑
Private function GetFilePath(FullPath)
If FullPath <> "" Then
GetFilePath = left(FullPath‚InStrRev(FullPath‚ "\"))
Else
GetFilePath = ""
End If
End function

'取得文件名
Private function GetFileName(FullPath)
If FullPath <> "" Then
GetFileName = mid(FullPath‚InStrRev(FullPath‚ "\")+1)
Else
GetFileName = ""
End If
End function

'取得擴展名
Private function GetFileExt(FullPath)
If FullPath <> "" Then
GetFileExt = mid(FullPath‚InStrRev(FullPath‚ ".")+1)
Else
GetFileExt = ""
End If
End function

End Class

'文件屬性類
Class FileInfo
dim FormName‚FileName‚FilePath‚FileSize‚FileType‚FileStart‚FileExt
Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
FileType = ""
FileExt = ""
End Sub

'保存文件方法
Public function SaveToFile(FullPath)
dim oFileStream‚ErrorChar‚i
SaveToFile=1
if trim(fullpath)="" or right(fullpath‚1)="/" then exit function
set oFileStream=CreateObject("Adodb.Stream")
oFileStream.Type=1
oFileStream.Mode=3
oFileStream.Open
oUpFileStream.position=FileStart
oUpFileStream.to oFileStream‚FileSize
oFileStream.SaveToFile FullPath‚2
oFileStream.Close
set oFileStream=nothing
SaveToFile=0
end function
End Class
%>

========================================
第三個文件:uploada.asp

<!--#include file="Inc/config.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
BODY{
BACKGROUND-COLOR: #f5feed;
font-size:9pt
}
.tx1 { height: 20px;font-size: 9pt; border: 1px solid; border-color: #000000; color: #0000FF}
-->
</style>
<link href="Manage/Inc/ManageMent.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%
if EnableUploadFile="Yes" then
%>
<form action="upfilea.asp" method="post" name="form1" enctype="multipart/form-data">
<input name="FileName" type="FILE" class="tx1" size="20">
<input type="submit" name="Submit" value="上傳" style="border:1px double rgb(88‚88‚88);font:9pt">
</form>
<%
end if
%>
</body>
</html>

============================
第四個文件:upfilea.asp

<!--#include file="Inc/config.asp"-->
<!--#include file="Inc/upload.asp"-->
<%
const upload_type=0 '上傳方法:0=無懼無組件上傳類,1=FSO上傳 2=lyfupload,3=aspupload,4=chinaaspupload

dim upload‚file‚formName‚SavePath‚filename‚fileExt
dim upNum
dim EnableUpload
dim Forumupload
dim ranNum
dim uploadfiletype
dim msg‚founderr
msg=""
founderr=false
EnableUpload=false
SavePath = "Upload" '存放上傳文件的目錄
if right(SavePath‚1)<>"/" then SavePath=SavePath&"/" '在目錄後加(/)
%>
<%
ComeinSTR=lcase(request.servervariables("HTTP_HOST"))
Url=split(ComeinSTR)
yourthing=Url(0)
%>
<html>
<head>
<link href="Manage/Inc/ManageMent.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
if EnableUploadFile="NO" then
response.write "系統未開放文件上傳功能"
else

select case upload_type
case 0
call upload_0() '使用化境無組件上傳類
case else

end select

end if
%>
</body>
</html>
<%
sub upload_0() '使用化境無組件上傳類
set upload=new upload_file '建立上傳對象
for each formName in upload.file '列出所有上傳了的文件
set file=upload.file(formName) '生成一個文件對象
if file.filesize<100 then
msg="請先選擇你要上傳的文件!"
founderr=true
end if
if file.filesize>(MaxFileSize*1024) then
msg="文件大小超過了限制,最大隻能上傳" & CStr(MaxFileSize) & "K的文件!"
founderr=true
end if

fileExt=lcase(file.FileExt)
Forumupload=split(UpFileType‚"|")
for i=0 to ubound(Forumupload)
if fileEXT=trim(Forumupload(i)) then
EnableUpload=true
exit for
end if
next
if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" then
EnableUpload=false
end if
if EnableUpload=false then
'msg="這種文件類型不允許上傳!\n\n只允許上傳這幾種文件類型:" & UpFileType
response.write"<script language=javascript>alert('這種文件類型不允許上傳!\n\n只允許上傳這幾種文件類型:" &

UpFileType & "');"
response.write"javascript:history.go(-1)</script>"
founderr=true
end if

strJS="<script language=javascript>" & vbcrlf
if founderr<>true then
randomize
ranNum=int(900*rnd)+100
filename=SavePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt

file.SaveToFile Server.mappath(FileName) '保存文件

msg="上傳文件成功!"

FileType=right(fileExt‚3)
select case FileType
case "jpg"‚"gif"‚"png"‚"bmp"
case "swf"
case else
strJS=strJS & "range.text=' 點擊瀏覽該文件';" & vbcrlf
end select
end if
strJS=strJS & "alert('" & msg & "');" & vbcrlf

strJS=strJS & "</script>"
response.write strJS
response.write "圖片上傳成功!文件路徑是 /" & filename & "<br>"
response.write "http://";; & yourthing & "/" & filename & "<br>"
set file=nothing
next
set upload=nothing
end sub
%>

『柒』 跪求使用smartupload組件實現圖片上傳的最簡單的jsp代碼

<%@ page contentType="text/html; charset=gbk" language="java" errorPage="" %>
<jsp:directive.page import="org.lxh.smart.SmartUpload"/>
<jsp:directive.page import="java.io.File"/>
<jsp:directive.page import="org.lxh.smart.Files"/>
<jsp:directive.page import="com..PathDao"/>
<jsp:directive.page import="com.entity.Photo"/>
<jsp:directive.page import="java.util.List"/>
<jsp:directive.page import="java.util.ArrayList"/>
<jsp:directive.page import="com..PhotoDao"/>
<jsp:directive.page import="com.impl.PhotoDaoImpl"/>
<%
int albumId=8;
int uId=Integer.parseInt(session.getAttribute("user").toString());
List<Photo> listPhoto=new ArrayList<Photo>();
// 新建一個SmartUpload對象
SmartUpload su = new SmartUpload();
try{
// 上傳初始化
su.initialize(pageContext);
// 設定上傳限制
// 1.限制每個上傳文件的最大長度。
//su.setMaxFileSize(10000);
// 2.限制總上傳數據的長度。
//su.setTotalMaxFileSize(20000);
// 3.設定允許上傳的文件(通過擴展名限制)。
//su.setAllowedFilesList("gif,jpg,png,GIF,JPG,PNG");
// 4.設定禁止上傳的文件(通過擴展名限制),禁止上傳帶有exe,bat,
//jsp,htm,html擴展名的文件和沒有擴展名的文件。
//su.setDeniedFilesList("exe,bat,jsp,htm,html,,");
// 上傳文件
su.upload();
// 將上傳文件全部保存到指定目錄
String temp="/upload/images/"+session.getAttribute("user");
//創建文件夾使用絕對路徑
String uploadPath =request.getRealPath("/")+temp;
if(!new File(uploadPath).isDirectory())
new File(uploadPath).mkdirs();
Files files=su.getFiles();
for(int i=0;i<files.getCount();i++){
org.lxh.smart.File file=files.getFile(i);
if(file.isMissing()){break;}
if(i>1){
if(file==files.getFile(i-1)){
continue;
}
if(i>2){
if(file==files.getFile(i-2)){
continue;
}
}
if(i>3){
if(file==files.getFile(i-3)){
continue;
}
}
}
PathDao pathDao=new PathDao();//這個類裡面實現一個getFileName方法,根據當前時間得到圖片名稱
String postfix="."+file.getFileExt();
//這個就是可以得到圖片的路徑了
String strtemp=uploadPath+"/"+pathDao.getFileName()+postfix;
file.saveAs(strtemp);
}
%>
<script>
alert("圖片上傳成功!");
</script>
<%
}catch (Exception e){
System.out.println(e.getMessage());
%>
<script>
alert("圖片上傳失敗!");
history.go(-1);
</script>
<%
}finally{
%>
<script>location="toYours.jsp?name=album.jsp";</script>
<%
}
%>

------------jsp頁面--------
<FORM METHOD="POST" ACTION="do_uploadPhotos.jsp"
ENCTYPE="multipart/form-data" name="uploadPhotoForm"
onSubmit="return check()">
<table width="75%" border="1" align="center">
<tr>
<td>
<div align="center">
1、
<input type="FILE" name="FILE1" size="30">
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
2、
<input type="FILE" name="FILE2" size="30">
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
3、
<input type="FILE" name="FILE3" size="30">
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
4、
<input type="FILE" name="FILE4" size="30">
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
<input type="submit" name="Submit1" value="上傳圖片">
</div>
</td>
</tr>
</table>

</FORM>

『捌』 上傳圖片組件問題

太難了!不明白什麼意思!

『玖』 圖片上傳插件!!!已經 滾動條!!!

搜一下Xproer.ImageUploader,這個是一個100%仿QQ空間中的圖片上傳控制項。

熱點內容
超級訪問董卿 發布:2024-10-20 07:44:35 瀏覽:235
ueditor多圖上傳 發布:2024-10-20 07:43:03 瀏覽:725
三星on7配置怎麼樣 發布:2024-10-20 07:39:26 瀏覽:430
android第三方so 發布:2024-10-20 07:37:52 瀏覽:881
瀏覽器書簽文件夾 發布:2024-10-20 07:32:47 瀏覽:169
vbnet文件夾選擇 發布:2024-10-20 07:19:28 瀏覽:311
jira國內訪問慢 發布:2024-10-20 07:08:29 瀏覽:698
舊密碼在哪裡找 發布:2024-10-20 06:48:59 瀏覽:828
存儲rpo 發布:2024-10-20 06:30:03 瀏覽:232
如何看蘋果手機型號配置 發布:2024-10-20 06:29:56 瀏覽:128