2026, 새로운 도약을 시작합니다.

첨부파일 목록에서 바로보기 채택완료

안녕하세요

질문하려구요

목록에서 첨부파일을 다운로드가 아닌 바로보기 하고 싶은데요

<?php if($list[$i]['file'][0]['file']){ ?><a href="/enbs/data/file/data/<?=$list[$i]['file'][0]['file']?>">설명서</a><?php }?>

이렇게 했더니 클릭하면 파일 다운로드 할건지 열건지 물어보는 창이 나오는데요

이것이 아니고 클릭하면 바로 열리게 하려면 어찌해야 할까요? 

답변 1개

링크 이미지를 바로 HTML 뷰어로 띄워주면됩니다.

아래 소스는 이미지 링크를 입력하면 HTML 파일없이 새창으로 이미지를 띄워주는 스크립트입니다.

응용해보세요.

Copy


제목 없음

var popbackground="ivory" //배경색상
var windowtitle="태그인넷" //타이틀 명function detectexist(obj){
return (typeof obj !="undefined")
}function jkpopimage(imgpath, popwidth, popheight, textdescription){function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
if (window.opera){
leftpos-=screenLefttoppos-=screenTop
}
}getpos()
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,left='+leftpos+',top='+toppos
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes)
else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30)
}
jkpopwin.document.open()
jkpopwin.document.write(''+windowtitle+'
'+textdescription+'')
jkpopwin.document.close()
jkpopwin.focus()
}

 태그인넷 열기 

출처는 예전에 인터넷으로 검색한거라 잘 모르겠습니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고