ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

728x90
SMALL

์ผ๋ฐ˜์ ์œผ๋กœ ์›น๋ธŒ๋ผ์šฐ์ €์—์„œ txtํŒŒ์ผ๋“ฑ์€ ๋‹ค์šด๋กœ๋“œ๊ฐ€ ๋˜์ง€ ์•Š๊ณ  ๋ฐ”๋กœ ์›น๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•ด ์—ด๋ฆฌ๋Š”๋ฐ

์ด๋Ÿฐ txt์ข…๋ฅ˜์˜ ํŒŒ์ผ๋„ ๋ฌด์กฐ๊ฑด ๋‹ค์šด๋กœ๋“œ ๋˜๊ฒŒ ํ•˜๋Š” ์†Œ์Šค์ž…๋‹ˆ๋‹ค.

Response.ContentType = "application/unknown"
'ContentType์„ ์„ ์–ธ

Response.Addheader "Content-Disposition", "attachment; filename=" & ํŒŒ์ผ์ด๋ฆ„
'ํ—ค๋”๊ฐ’์ด ์ฒจ๋ถ€ํŒŒ์ผ์„ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค.

Set objStream = Server.CreateObject("ADODB.Stream")
'Stream์„ ์ด์šฉํ•ฉ๋‹ˆ๋‹ค.

objStream.Open
'๋ฌด์—‡์ด๋“  Set์œผ๋กœ ์ •์˜ํ–ˆ์œผ๋ฉด ์—ด์–ด์•ผ ๊ฒ ์ง€์š”^^

objStream.Type = 1

objStream.LoadFromFile Server.MapPath("์ž๋ฃŒ๊ฐ€ ์ €์žฅ๋˜์–ด์žˆ๋Š” ํด๋” ์œ„์น˜") & "\" & ํŒŒ์ผ๋ช…
'์ ˆ๋Œ€๊ฒฝ๋กœ ์ž…๋‹ˆ๋‹ค.

download = objStream.Read
Response.BinaryWrite download

Set objstream = nothing


ํŽŒ : http://cafe.naver.com/myprogramming.cafe

728x90
LIST
๋Œ“๊ธ€
๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2025/04   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
๊ธ€ ๋ณด๊ด€ํ•จ
250x250