auto php upload

Discussion in 'PHP' started by poyor7, Jul 6, 2006.

  1. #1
    Hi,

    Emmm i wanna know whether possible to do this :

    Senario A:

    I've a form actually .csv, when a user finished filling out the form,after that when user click save button auto upload the file .csv file from server A where original .csv file(testing server) to server B (life server).

    Senario B:

    Same concept but when user click save button,the save button disable and button upload will appear but cannot browser and it is possible to put value in input type="file"??? The reason don;t want user to have capability to browse server A(testing server).

    PS:please dont ask why such things to do like this....

    Rgds
    Poyor7
     
    poyor7, Jul 6, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mad4, Jul 6, 2006 IP
  3. poyor7

    poyor7 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi...

    I found something interesting but i bit blur and need some guidance....could anyone guide me through this example :http://us2.php.net/manual/en/ref.filesystem.php

    regards
    poyor7
     
    poyor7, Jul 6, 2006 IP
  4. poyor7

    poyor7 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi..
    Can anyone of you help me...where should i change the code in order to get .csv file only

    // ls(dir,pattern) return file list in "dir" folder matching "pattern"
    // ls("path","module.php?") search into "path" folder for module.php3, module.php4, ...
    // ls("images/","*.jpg") search into "images" folder for JPG images
    
    function ls($__dir="./",$__pattern="*.*")
    {
     settype($__dir,"string");
     settype($__pattern,"string");
    
     $__ls=array();
     $__regexp=preg_quote($__pattern,"/");
     $__regexp=preg_replace("/[\\x5C][\x2A]/",".*",$__regexp);
     $__regexp=preg_replace("/[\\x5C][\x3F]/",".", $__regexp);
    
     if(is_dir($__dir))
      if(($__dir_h=@opendir($__dir))!==FALSE)
      {
       while(($__file=readdir($__dir_h))!==FALSE)
       if(preg_match("/^".$__regexp."$/",$__file))
         array_push($__ls,$__file);
    
       closedir($__dir_h);
       sort($__ls,SORT_STRING);
      }
    
     return $__ls;
    } 
    
    PHP:
     
    poyor7, Jul 7, 2006 IP