Jump to content

How to upload remotely to a sub folder

- - - - -

  • Please log in to reply
1 reply to this topic

#1
MicroBoy

MicroBoy

    Newbie

  • Members
  • PipPip
  • 22 posts
Hi I have the above script to download files remotely from other servers to mine, and it works all right, but it saves the file at the folder where the script is, I want to save at a sub directory not at that folder. What I need to change...?

define('BUFSIZ', 4095);

$urlf = $_POST['urlf'];

$url = basename($urlf);

$rfile = fopen($urlf, 'r') or die("fotoja nuk mund te hapet");

$lfile = fopen(basename($urlf), 'w');

while(!feof($rfile))

fwrite($lfile, fread($rfile, BUFSIZ), BUFSIZ);

fclose($rfile);

fclose($lfile);


#2
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
change this
 

$lfile = fopen(basename($urlf), 'w');
to
 

$lfile = fopen("yourdirectory/".basename($urlf), 'w');

yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users