ACTIVE SERVER PAGE > File ´Ù¿î·Îµå µî·ÏÀÏ : 2017-07-03 20:17 Á¶È¸¼ö : 52,958^^ ¾È³çÇϼ¼¿ä.
º¸ÅëÀÇ ÀÚ·á½Ç¿¡ º¸¸é,,, text ÈÀÏÀ̳ª ±×¸²,, ¶Ç´Â Office °ü·Ã ÈÀϵéÀº ºê¶ó¿ìÁ®¿¡¼ ÀÚµ¿À¸·Î ¶ç¿ö ¹ö¸³´Ï´Ù. ±×·³, ¸¸¾à text,±×¸²,Office ÈÀϱîÁöµµ ´Ù¿îÀ» ¹Þ°í ½Í´Ù¸é ¾î¶»°Ô ÇÏ¸é µÉ±î¿©? ContentType °ú html Çì´õÀÇ Á¶ÀÛÀ¸·Î °¡´ÉÇÕ´Ï´Ù. IIS¿¡¼ MIME TypeÀ» ¼³Á¤ÇÒ¼öµµ, ¹Ù²Ü¼öµµ ÀÖ´Ù´Â »ç½ÇÀº ¾Ë°í °è½Ã¸®¶ó ¹Ï½À´Ï´Ù.
ÀÏ´Ü ´Ù¿î ¹öÆ°À» ´©¸£¸é,,, down.asp ÈÀÏ·Î º¸³À´Ï´Ù. down.asp?fname=a.txt ÀÌ·±½ÄÀ¸·Î º¸³»¸é µÇ°ÚÁö¿ä? µ¥ÀÌŸ º£À̽º¿¡ ÈÀÏÀ̸§ÀÌ ÀúÀåµÇ¾î ÀÖÀ» °Ì´Ï´Ù. À§ÀÇ ¼Ò½º¿¡¼´Â ADO 2.5 ¿¡ Æ÷ÇԵǾî ÀÖ´Â Stream °´Ã¼¸¦ ÀÌ¿ëÇÏ¿© ´Ù¿î ¹Þ´Â ºÎºÐÀ» ÇØ°áÇß½À´Ï´Ù. Stream °´Ã¼¿¡ Æ÷ÇԵǾî ÀÖ´Â LoadFromFile ¸Þ¼Òµå¿Í ReadText ¸Þ¼Òµå¸¦ ÀÌ¿ëÇؼ ÈÀÏÀ» ÀÐ¾î ¿Ô½À´Ï´Ù. Response.BinaryWrite ¸¦ ÀÌ¿ëÇØ Å¬¶óÀÌ ¾ðÆ®¿¡ ÀúÀåÇÏ°Ô µË´Ï´Ù. ^^ filename="&fname Àº ÀúÀåÇÒ ÈÀÏÀÇ À̸§À̶ø´Ï´Ù. »ý°¢º¸´Ü ³Ê¹« °£´ÜÇÏÁö¿ä? µµ¿òÀÌ µÇ¼Ì±æ ¹Ù¶ø´Ï´Ù. ¾Æ·¡´Â ¶Ç´Ù¸¥ ¹æ¹ýÀÔ´Ï´Ù.(SiteGalaxyUpload) Response.ContentType ="application/x-gzip" fname=Request("fname") Response.AddHeader "Content-Disposition", "attachment;filename="&fname str_dir="c:\temp\" set fso = server.CreateObject ("SiteGalaxyUpload.filesystemobject") set file = fso.OpenBinaryFile (str_dir&fname,1,false) Response.BinaryWrite file.readall Response.End ContentType Á¾·ù Response.ContentType = "application/x-msdownload" Response.ContentType = "application/x-gzip" Response.ContentType = "application/unknown" Response.ContentType = "application/vnd.ms-excel"
|