liza Posted May 17, 2007 Share Posted May 17, 2007 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) Quote Link to comment https://forums.phpfreaks.com/topic/51812-i-have-a-small-problem-with-ftp-script/ Share on other sites More sharing options...
SamLiu Posted May 21, 2007 Share Posted May 21, 2007 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 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 Quote Link to comment https://forums.phpfreaks.com/topic/51812-i-have-a-small-problem-with-ftp-script/#findComment-258013 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.