ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


Flex¿Í PHP¸¦ ÀÌ¿ëÇؼ­ ¸¸µç ÆÄÀϾ÷·Îµå ¼Ò½º
12³â Àü
¾Æ·¡ ÄÚµå´Â Flex¿Í PHP¸¦ ÀÌ¿ëÇؼ­ ÆÄÀÏ ¾÷·Îµå¸¦ ±¸ÇöÇÑ °ÍÀ̶ó°í Çϳ׿ä-_-

FileUpDown.mxml (Language : xml)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
  <![CDATA[
   import mx.controls.Alert;
  
   private var fr:FileReference;;

   public function Download():void {

    fr = new FileReference();  
    fr.addEventListener(Event.OPEN,onOpenFile);
    fr.addEventListener(ProgressEvent.PROGRESS,onFileProgress);
    fr.addEventListener(Event.COMPLETE,onCompleteDownload);
    
    var request:URLRequest = new URLRequest();
    request.url = "rank.tar.gz";
    
    try {
     fr.download(request);
    } catch (e:SecurityError){
     Alert.show(e.toString());
    }
   }

   public function onOpenFile(event:Event):void {
    dpg.label = '´Ù¿î·Îµå %3%%';
   }
  
   public function onCompleteDownload(event:Event):void {
    Alert.show('´Ù¿î·Îµå ¿Ï·á');
   }
  
   public function onFileProgress(event:ProgressEvent):void {
    dpg.setProgress(event.bytesLoaded,event.bytesTotal);
   }
  
   public function Upload():void {
    
    fr = new FileReference();
    fr.addEventListener(Event.SELECT,onUploadSelectFile);
    fr.addEventListener(Event.OPEN,onUploadOpenFile);
    fr.addEventListener(ProgressEvent.PROGRESS,onUploadFileProgress);
    fr.addEventListener(Event.COMPLETE,onUploadCompleteDownload);

    var imgFilter:FileFilter = new FileFilter("Images(*.png;*.gif;*.jpg)","*.png;*.gif;*.jpg");
    var arcFilter:FileFilter = new FileFilter("Archives(*.zip;*.gz;*.tar)","*.zip;*.gz;*.tar");
    var allFilter:FileFilter = new FileFilter("All(*.*)","*.*");
    fr.browse([imgFilter,arcFilter,allFilter]);  

   }

   public function onUploadSelectFile(event:Event):void {
    var request:URLRequest = new URLRequest();
    request.url = "upload.php";
        
    try {
     fr.upload(request,"file");
    } catch (e:SecurityError){
     Alert.show(e.toString());
    }    
   }
  
   public function onUploadOpenFile(event:Event):void {
    upg.label = '¾÷·Îµå %3%%';
   }
  
   public function onUploadCompleteDownload(event:Event):void {
    Alert.show('¾÷·Îµå ¿Ï·á');
   }
  
   public function onUploadFileProgress(event:ProgressEvent):void {
    upg.setProgress(event.bytesLoaded,event.bytesTotal);
   }
  ]]>
</mx:Script>
<mx:Button x="10" y="10" label="Dowload" click="Download()"/>
<mx:Label id="filepg" x="93" y="12"/>
<mx:ProgressBar x="10" y="38" width="351" label="" id="dpg" mode="manual"/>
<mx:ProgressBar x="10" y="110" width="351" label="" id="upg" mode="manual"/>
<mx:Button x="10" y="80" label="Upload" click="Upload()" width="75"/>
</mx:Application>


upload.php (Language : php)
<?
$file_temp = $_FILES['file']['tmp_name'];
$file_name = $_FILES['file']['name'];
$file_size = $_FILES['file']['size'];

$updir = "D:/wwwroot/test/html/upload";

if(!empty($file_name)){
$filename = sprintf("%s/%s",$updir,$file_name);
$filename = iconv("UTF-8", "EUC-KR",$filename);  // ÇѱÛó¸®

if(!file_exists($filename)) {
  if(move_uploaded_file($file_temp,$filename)){
  } else {
  }
}
}

fclose($fp);
?>
ÃßõÃßõ : 521 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,015
·£´ý¹è³Ê¼Ò½º + ·£´ý ¾ÆÀÌÇÁ·¹ÀÓ ¼Ò½º
2,014
ÀÚµ¿»õ·Î°íħ
2,013
iframe´ë½Å div¸¦ ÀÀ¿ëÇغ¸ÀÚ
2,012
´ÙÀ½Ä«Æä ¸ÞÀο¡ ¾ÆÀÌÇÁ·¹ÀÓ »ç¿ëÇϱâ
2,011
url¿¡ get°ª °¡Á®¿À±â
2,010
PHP ÀÚÁÖ ¾²´Â ÇÔ¼öµé
2,009
µð·ºÅ丮¿¡ ÀÖ´Â À̹ÌÁö ÆÄÀÏÀ» Àоîµé¿© º¸¿©ÁÖ´Â À̹ÌÁö °¶·¯¸®
2,008
µðºñ³»¿ëÀ» ¿¢¼¿ ÆÄÀÏ·Î ´Ù¿î·Îµå ½ÃÅ°´Â ¹æ¹ý
2,007
PHP¿¡¼­ MySQL Á¢¼ÓÇϱâ
2,006
PHP¿¡¼­ Á¢¼ÓÀÚ IP ¾Ë¾Æ³»±â
2,005
°Ô½ÃÆÇ°Ë»öÀ̳ª ¼îÇθô¿¡ À¯¿ëÇÑ ÀÚ¹Ù½ºÅ©¸³Æ®
2,004
¸®´ª½º ftp ¸í·É¾î ¸ðÀ½
2,003
PHP ¹öºí¼ÒÆ® ¾Ë°í¸®Áò
2,002
PHP¿¡¼­ ¼º´É °³¼±À» À§ÇÑ À¯¿ëÇÑ ÆÁ
Flex¿Í PHP¸¦ ÀÌ¿ëÇؼ­ ¸¸µç ÆÄÀϾ÷·Îµå ¼Ò½º
2,000
PHP ÇöÀç Á¢¼ÓÀÚ ÇöȲ º¸¿©ÁÖ±â
1,999
PHP Caching to speed up
1,998
post, get, cookie, session º¯¼ö È®ÀÎ
1,997
PHP ¹®ÀÚ¿­Áß ¼ýÀÚ¸¸ ÃßÃâÇϱâ
1,996
¹«Á¶°Ç ¾Ë¾Æ¾ß ÇÒ PHP ¼Óµµ Å×½ºÆ® 14 °¡Áö
1,995
PHP ¹®ÀÚ¿­ ¿¬°áÇϱâ
1,994
PHP ¼ýÀÚ ÃµÀÚ¸®¸¶´Ù ÄÞ¸¶(½°Ç¥) Âï±â
1,993
PHP - RSS ¸®´õ±â
1,992
PHP ¸ÞÀÏ(mail) ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ Ã·ºÎÈ­ÀÏ Àü¼ÛÇϱâ
1,991
PHP ÇÔ¼ö °£´Ü Á¤¸®
1,990
PHP¿¡¼­ ¼¼¼Ç(session) »ç¿ëÇϱâ
1,989
PHP explode ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ ¹®ÀÚ¿­ ºÐ¸®
1,988
PHP split ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ ¹®ÀÚ¿­ ºÐ¸®
1,987
PHP À̸§ÀÌ °°Àº Æûű×(Form Tag)ÀÇ °ª(value) ó¸®Çϱâ
1,986
PHP ¿À´Ã³¯Â¥¸¦ ±âÁØÀ¸·Î ÀÌÀü,ÀÌÈÄ ³¯Â¥±¸Çϱâ
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.