Jump to content

Recommended Posts

Hello,

i downloaded an ftp script but i had to do some modifications and i have a problem in downloding a file

i have subfolders in each account main folder , i developed a function to get me the name of the folder to open with ftp_chdir() function and it works well but if i have 2 subfolders it doesnot work..

i will explain more..

when i get the name of the folder i put it in a sesstion for other pages to see like ( view, download, delete,...) which use this session to get the file located in that folder but if i have 2 sub folders i want to get the full path of the file to get it , for example if i have a file path: Folder1/Folder2/file.txt

i want to make a session with the name of the subfolders (Folder1/Folder2) so i can get the file..

how can i do it????

 

also when i returned to the previous folder i want to modify the session ...

here are a sample of the code

 

if ($chdir)// where chdir is the name of the button to open the folder

       {

              if($chdir==" ")

              unset($_SESSION[directory]);

               else{

               ftp_chdir ($connection,$chdir);

               $_SESSION[directory] = $chdir;

           }

       }

 

if (ftp_get ($conexion, "tmp/".$tmpname, $file, 1))//temp is a temporary folder to open the file in (local)

Link to comment
https://forums.phpfreaks.com/topic/51812-i-have-a-small-problem-with-ftp-script/
Share on other sites

you need to add some more code, its not very helpful not having a big enough chunk of code. from what I see, it may be that you're trying to change to a directory under subfolders but its the equivalent of...

 

well...lets say you're in /.

 

You want to open /home/whatever.

But what you're telling the program is /whatever, which doesnt exist.

 

So your job is to code something that opens /home/whatever. that middle directory there.

 

How you should do it, I wouldnt know cause you didnt give me enough code to read  ;D

 

but yeah if you post it I might get to it some other time or someone else around here might be able to help you.

 

Reguards,

Sam

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.