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


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);
?>
ÃßõÃßõ : 517 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
103
php xml parse 3Á¾ ¼¼Æ®
102
php ³»ÀåÇÔ¼öÀ» ÀÌ¿ëÇÑ XML Parser
101
HTML À¥¹®¼­ÀÇ TAG Áö¿ì°í º»¹®¸¸ ³²±â±â, php ¸í·É¸ðµå¿¡¼­ ½ÇÇàÇϱâ
100
ÅÂ±× Á¦°Å ÇÔ¼ö strip_tags2 & ¸µÅ© ÃßÃâ ÇÔ¼ö extract_link
99
PHP ±â¹Ý À¥ Ž»ö±â ºñ±³
98
escape(), encodeURI(), encodeURIComponent() Â÷ÀÌÁ¡
97
php HereDoc(EDO)¹®ÀÚ »ç¿ë¹ý
96
include / require / include_once Â÷ÀÌÁ¡
95
(ÇÔ¼ö) ereg,eregi, Á¤±ÔÇ¥Çö½Ä
94
ob_start
93
htmlspecialchars
92
PHP Fatal error: Cannot redeclare class Object in
91
url¿¡ get°ª °¡Á®¿À±â
90
PHP ÀÚÁÖ ¾²´Â ÇÔ¼öµé
89
µð·ºÅ丮¿¡ ÀÖ´Â À̹ÌÁö ÆÄÀÏÀ» Àоîµé¿© º¸¿©ÁÖ´Â À̹ÌÁö °¶·¯¸®
88
µðºñ³»¿ëÀ» ¿¢¼¿ ÆÄÀÏ·Î ´Ù¿î·Îµå ½ÃÅ°´Â ¹æ¹ý
87
PHP¿¡¼­ MySQL Á¢¼ÓÇϱâ
86
PHP¿¡¼­ Á¢¼ÓÀÚ IP ¾Ë¾Æ³»±â
85
¸®´ª½º ftp ¸í·É¾î ¸ðÀ½
84
PHP ¹öºí¼ÒÆ® ¾Ë°í¸®Áò
83
PHP¿¡¼­ ¼º´É °³¼±À» À§ÇÑ À¯¿ëÇÑ ÆÁ
Flex¿Í PHP¸¦ ÀÌ¿ëÇؼ­ ¸¸µç ÆÄÀϾ÷·Îµå ¼Ò½º
81
PHP ÇöÀç Á¢¼ÓÀÚ ÇöȲ º¸¿©ÁÖ±â
80
PHP Caching to speed up
79
post, get, cookie, session º¯¼ö È®ÀÎ
78
PHP ¹®ÀÚ¿­Áß ¼ýÀÚ¸¸ ÃßÃâÇϱâ
77
¹«Á¶°Ç ¾Ë¾Æ¾ß ÇÒ PHP ¼Óµµ Å×½ºÆ® 14 °¡Áö
76
PHP ¹®ÀÚ¿­ ¿¬°áÇϱâ
75
PHP ¼ýÀÚ ÃµÀÚ¸®¸¶´Ù ÄÞ¸¶(½°Ç¥) Âï±â
74
PHP - RSS ¸®´õ±â
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.