1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Move_uploaded_file

Discussion in 'Development' started by tungstenvm, Feb 8, 2019.

  1. tungstenvm

    tungstenvm Witch

    Messages:
    54
    Hello, i have a file in main folder ( same folder of bin file, pocketmine file, plugins ), and i want to move it to bin folder, so what link of destination need i use. i tried : ./bin/ but didnt work, thanks in advance
     
  2. tungstenvm

    tungstenvm Witch

    Messages:
    54
    i dont know where is the link start?, from the main folder ( same folder of pocketmine.phar) or in the plugins folder?.

    if i want to move a file abc.dll in plugins folder to bin/php/ext/. what is the code i need?. move_uploaded_file('abc','./bin/php/ext)? thanks u very much
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    The path of the main folder is...
    PHP:
    $main_folder $server->getDataPath();
    From there, you can move a file to the bin folder...
    PHP:
    $target $main_folder "bin/php/ext/";
    Btw, what are you trying to do by moving a .dll in there? o_O
     
  4. tungstenvm

    tungstenvm Witch

    Messages:
    54
    thanks you
     
  5. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    I think he's trying to put an extension without recompiling, from his past posts he might be trying to put FTP extension in the PHP bin
     
  6. tungstenvm

    tungstenvm Witch

    Messages:
    54
    I tried but it didnt work. I have a abc.txt in plugins
    folder (plugins/abc.txt ). Then i use
    PHP:
    move_uploaded_file('./plugins/abc.txt' './bin/'); (bin folder instead)
    and it return false
    i tried like you do too but it the same because ./ is same as $server->getDataPath().
     
  7. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    PHP:
    move_uploaded_file("plugins\abc.txt""bin\\");
     
  8. tungstenvm

    tungstenvm Witch

    Messages:
    54
    does it work to u :v because it still doesnt work to me :(
     
  9. di2134876

    di2134876 Spider Jockey

    Messages:
    29
    GitHub:
    dk1234987
    (This is KielKing on another account)


    Quote from PHP.net
    This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.

    If filename is not a valid upload file, then no action will occur, andmove_uploaded_file() will return FALSE. <--- you have this issue
     
  10. tungstenvm

    tungstenvm Witch

    Messages:
    54
    yea, i use rename() and it work now
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.